From af5983adc9573b90b8e99e02c04c43d3bbf4a3de Mon Sep 17 00:00:00 2001 From: Kenneth Sills <132029135+Kenneth-Sills@users.noreply.github.com> Date: Tue, 27 Aug 2024 17:07:56 +0000 Subject: [PATCH] chore: minor cleanup - Remove unneeded eslint annotation. - Remove type checking skip, in favor of specifying types. --- lib/shared.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/shared.js b/lib/shared.js index 837cb67..1ce4b09 100644 --- a/lib/shared.js +++ b/lib/shared.js @@ -1,11 +1,9 @@ -/* eslint-disable import/no-extraneous-dependencies */ const { rules: baseBestPracticesRules } = require('eslint-config-airbnb-base/rules/best-practices'); const { rules: baseErrorsRules } = require('eslint-config-airbnb-base/rules/errors'); const { rules: baseES6Rules } = require('eslint-config-airbnb-base/rules/es6'); const { rules: baseImportsRules } = require('eslint-config-airbnb-base/rules/imports'); const { rules: baseStyleRules } = require('eslint-config-airbnb-base/rules/style'); const { rules: baseVariablesRules } = require('eslint-config-airbnb-base/rules/variables'); -/* eslint-enable import/no-extraneous-dependencies */ module.exports = { plugins: ['@typescript-eslint', '@stylistic'], @@ -15,6 +13,7 @@ module.exports = { 'import/parsers': { '@typescript-eslint/parser': ['.ts', '.tsx', '.d.ts'], }, + // Append 'ts' extensions to Airbnb 'import/resolver' setting // Original: ['.mjs', '.js', '.json'] 'import/resolver': { @@ -22,9 +21,11 @@ module.exports = { extensions: ['.mjs', '.js', '.json', '.ts', '.d.ts'], }, }, + // Append 'ts' extensions to Airbnb 'import/extensions' setting // Original: ['.js', '.mjs', '.jsx'] 'import/extensions': ['.js', '.mjs', '.jsx', '.ts', '.tsx', '.d.ts'], + // Resolve type definition packages 'import/external-module-folders': ['node_modules', 'node_modules/@types'], }, @@ -182,7 +183,10 @@ module.exports = { devDependencies: baseImportsRules[ 'import/no-extraneous-dependencies' ][1].devDependencies.reduce( - // @ts-expect-error + /** + * @param {string[]} result + * @param {string} devDep + */ (result, devDep) => { const toAppend = [devDep]; const devDepWithTs = devDep.replace(/\bjs(x?)\b/g, 'ts$1');