diff --git a/package.json b/package.json index fefd3fe..70b40d8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sixxgate/lint", - "version": "3.1.1", + "version": "3.1.2", "packageManager": "yarn@1.22.22", "main": "dist/index.cjs", "author": "Matthew Holder ", diff --git a/src/components/node.cts b/src/components/node.cts index bdcfad1..1bd9b45 100644 --- a/src/components/node.cts +++ b/src/components/node.cts @@ -66,6 +66,15 @@ const NodeComponent = defineComponent('node', ({ getComponent }) => { ...getStandardNodeRules() } + config.overrides = config.overrides ?? [] + config.overrides.push({ + files: ['**/.eslintrc.*'], + rules: { + // ESLint will use unpublished modules. + 'n/no-unpublished-require': 'off' + } + }) + return config } diff --git a/src/components/typescript.cts b/src/components/typescript.cts index 824d941..65c6d5e 100644 --- a/src/components/typescript.cts +++ b/src/components/typescript.cts @@ -70,6 +70,8 @@ function getStandardTypeScriptRules(): Linter.RulesRecord { // Causes too many issues with callback parameters, // so this will be a rare diviation from strict. '@typescript-eslint/unified-signatures': 'off', + // Prevents really common usecases for generics. + '@typescript-eslint/no-unnecessary-type-parameters': 'off', // Handled by and conflicts with prettier. '@typescript-eslint/no-extra-semi': 'off' } @@ -131,14 +133,23 @@ const TypeScriptComponent = Object.assign( } config.overrides = config.overrides ?? [] - config.overrides.push({ - files: ['**/*.js', '**/*.cjs', '**/*.mjs', '**/*.jsx'], - extends: ['plugin:@typescript-eslint/disable-type-checked'], - rules: { - // This is transpiled by TypeScript and not support in JavaScript. - '@typescript-eslint/no-var-requires': 'off' + config.overrides.push( + { + files: ['**/*.js', '**/*.cjs', '**/*.mjs', '**/*.jsx'], + extends: ['plugin:@typescript-eslint/disable-type-checked'], + rules: { + // This is transpiled by TypeScript and not support in JavaScript. + '@typescript-eslint/no-var-requires': 'off' + } + }, + { + files: ['**/*.cjs', '**/*.cts'], + rules: { + // CommonJS modules should not be barred from this. + '@typescript-eslint/no-require-imports': 'off' + } } - }) + ) return config }