Skip to content

Commit

Permalink
chore: minor cleanup
Browse files Browse the repository at this point in the history
- Remove unneeded eslint annotation.
- Remove type checking skip, in favor of specifying types.
  • Loading branch information
Kenneth-Sills committed Aug 27, 2024
1 parent 59191c1 commit af5983a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/shared.js
Original file line number Diff line number Diff line change
@@ -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'],
Expand All @@ -15,16 +13,19 @@ 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': {
node: {
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'],
},
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit af5983a

Please sign in to comment.