Skip to content

Commit

Permalink
Activate eslint reportUnusedDisableDirectives
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinigami92 committed Apr 26, 2023
1 parent ec647b2 commit ab19ea8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module.exports = defineConfig({
es6: true,
node: true,
},
reportUnusedDisableDirectives: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"clean": "rimraf .eslintcache dist pnpm-lock.yaml node_modules",
"check": "tsc",
"format": "prettier --cache --write .",
"lint": "eslint --cache --cache-strategy content .",
"lint": "eslint --cache --cache-strategy content --report-unused-disable-directives .",
"typecheck": "vitest typecheck",
"test": "vitest",
"coverage": "vitest run --coverage",
Expand Down
5 changes: 2 additions & 3 deletions scripts/generate-rule-files/src/plugins-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,9 @@ export async function loadPlugin(plugin: Plugin): Promise<Plugin> {
const rules: PluginRules =
plugin.module === 'eslint'
? Object.fromEntries(
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
new mod.Linter().getRules().entries(),
)
: // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
mod.rules ?? mod.default.rules;
: mod.rules ?? mod.default.rules;
return { ...plugin, rules };
}
2 changes: 0 additions & 2 deletions tests/generate-rule-files.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/no-unsafe-argument */

import type { Rule } from 'eslint';
import { describe, expect, it } from 'vitest';
import { generateTypeFromSchema } from '../scripts/generate-rule-files/src/json-schema-to-ts';
Expand Down

0 comments on commit ab19ea8

Please sign in to comment.