Skip to content

Commit

Permalink
fix: πŸ› favor reportUnusedDisableDirectives instead (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmy-guzman authored Nov 2, 2024
1 parent 2f17fe9 commit eb17660
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 11 deletions.
26 changes: 16 additions & 10 deletions src/factory.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,22 @@ vi.mock("local-pkg");

describe("jimmyDotCodes", () => {
describe("base", () => {
it.each(["node", "imports", "perfectionist", "unicorn", "eslint-comments"])(
"should create configuration w/ %s",
(input) => {
expect(jimmyDotCodes({ autoDetect: false })).toStrictEqual(
expect.arrayContaining([
expect.objectContaining({ name: `jimmy.codes/${input}` }),
]),
);
},
);
it.each([
"node",
"imports",
"perfectionist",
"unicorn",
"eslint-comments",
"prettier",
"ignores",
"base",
])("should create configuration w/ %s", (input) => {
expect(jimmyDotCodes({ autoDetect: false })).toStrictEqual(
expect.arrayContaining([
expect.objectContaining({ name: `jimmy.codes/${input}` }),
]),
);
});
});

it("should create configuration w/ typescript", () => {
Expand Down
8 changes: 7 additions & 1 deletion src/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ export const jimmyDotCodes = (
const isAstroEnabled = astro || (autoDetect && hasAstro());

return [
{ name: "jimmy.codes/base", rules: baseRules },
{
linterOptions: {
reportUnusedDisableDirectives: true,
},
name: "jimmy.codes/base",
rules: baseRules,
},
...perfectionistConfig(),
...nodeConfig(),
...unicornConfig(),
Expand Down
1 change: 1 addition & 0 deletions src/rules/__snapshots__/eslint-comments.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ exports[`should create eslintComments rules 1`] = `
"@eslint-community/eslint-comments/no-aggregating-enable": "error",
"@eslint-community/eslint-comments/no-duplicate-disable": "error",
"@eslint-community/eslint-comments/no-unlimited-disable": "error",
"@eslint-community/eslint-comments/no-unused-disable": "off",
"@eslint-community/eslint-comments/no-unused-enable": "error",
"@eslint-community/eslint-comments/require-description": "error",
}
Expand Down
1 change: 1 addition & 0 deletions src/rules/eslint-comments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ import type { Rules } from "../types";

export const eslintCommentsRules = {
...comments.recommended.rules,
"@eslint-community/eslint-comments/no-unused-disable": "off",
"@eslint-community/eslint-comments/require-description": "error",
} satisfies Rules;

0 comments on commit eb17660

Please sign in to comment.