diff --git a/.dependency-cruiser.js b/.dependency-cruiser.js index 7bbb1694..1c80e203 100644 --- a/.dependency-cruiser.js +++ b/.dependency-cruiser.js @@ -1,3 +1,5 @@ +/* eslint-disable import/no-commonjs */ +/* eslint-disable import/unambiguous */ /* eslint-disable max-lines */ /* eslint-disable multiline-comment-style */ /** @type {import('dependency-cruiser').IConfiguration} */ diff --git a/.eslintrc.json b/.eslintrc.json index 4bc3b826..7a33e51d 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -11,24 +11,13 @@ "hardcore/ts" ], "overrides": [ - { - "files": [ - "*.test.ts" - ], - "rules": { - "func-names": "off" - } - }, { "files": [ "*.js" ], "rules": { "@typescript-eslint/explicit-function-return-type": "off", - "@typescript-eslint/prefer-readonly-parameter-types": "off", - "import/no-commonjs": "off", - "import/unambiguous": "off", - "putout/putout": "off" + "@typescript-eslint/prefer-readonly-parameter-types": "off" } } ], @@ -111,6 +100,7 @@ "error", "always-multiline" ], + "compat/compat": "off", "curly": [ "error", "multi" @@ -153,6 +143,7 @@ "always" ], "padding-line-between-statements": "off", + "prefer-destructuring": "off", "prettier/prettier": "off", "putout/putout": "off", "quote-props": [ diff --git a/package.json b/package.json index dd0ba24e..b5db204c 100644 --- a/package.json +++ b/package.json @@ -56,8 +56,8 @@ "postversion": "git push && git push --tags && pnpm build && npm publish", "preversion": "pnpm check", "start": "pnpm build:start && echo start success", - "test": "pnpm test:watch --run && echo test success", - "test:bench": "vitest bench", + "test": "vitest --coverage --run && echo test success", + "test:bench": "vitest bench && echo test bench success", "test:update": "vitest --run --update && echo test update success", "test:watch": "vitest --coverage" }, diff --git a/templates/.dependency-cruiser.js b/templates/.dependency-cruiser.js index 593961b9..e062d8a8 100644 --- a/templates/.dependency-cruiser.js +++ b/templates/.dependency-cruiser.js @@ -1,3 +1,5 @@ +/* eslint-disable import/no-commonjs */ +/* eslint-disable import/unambiguous */ /* eslint-disable no-useless-escape */ /* eslint-disable multiline-comment-style */ /* eslint-disable max-lines */ diff --git a/tests/__snapshots__/check.test.ts.snap b/tests/__snapshots__/check.test.ts.snap index efab7484..bfc3bafb 100644 --- a/tests/__snapshots__/check.test.ts.snap +++ b/tests/__snapshots__/check.test.ts.snap @@ -227,7 +227,7 @@ exports[`check C data/tsProject 1`] = ` "warnings": [ "use-dependency-cruiser", "eslintrc-json-could-have-unicorn-rules-extend-plugin-unicorn-all", - "eslintrc-json-current-eslintrc-json-has-only-1-of-the-62-custom-rules-in-repo-checker-eslintrc-json", + "eslintrc-json-current-eslintrc-json-has-only-1-of-the-64-custom-rules-in-repo-checker-eslintrc-json", "has-a-npmrc-file", "package-json-main-file-maximum-size-is-specified-in-data-file-ex-max-size-ko-100", "package-json-could-have-a-schema-declaration-like-schema-https-json-schemastore-org-package-43m30m-fixable-39m49m", @@ -332,7 +332,7 @@ exports[`check E data folders and not throw 1`] = ` "warnings": [ "use-dependency-cruiser", "eslintrc-json-could-have-unicorn-rules-extend-plugin-unicorn-all", - "eslintrc-json-current-eslintrc-json-has-only-1-of-the-62-custom-rules-in-repo-checker-eslintrc-json", + "eslintrc-json-current-eslintrc-json-has-only-1-of-the-64-custom-rules-in-repo-checker-eslintrc-json", "has-a-npmrc-file", "package-json-main-file-maximum-size-is-specified-in-data-file-ex-max-size-ko-100", "package-json-could-have-a-schema-declaration-like-schema-https-json-schemastore-org-package-43m30m-fixable-39m49m", diff --git a/tests/data/vueProject/tailwind.config.js b/tests/data/vueProject/tailwind.config.js index 2a8dd6b7..0b9283ab 100644 --- a/tests/data/vueProject/tailwind.config.js +++ b/tests/data/vueProject/tailwind.config.js @@ -1,3 +1,4 @@ +// eslint-disable-next-line import/unambiguous, import/no-commonjs module.exports = { content: ['public/*.html', './src/**/*.{vue,js,ts,jsx,tsx}'], safelist: [ diff --git a/tests/files/__snapshots__/eslint.test.ts.snap b/tests/files/__snapshots__/eslint.test.ts.snap index d6ec30be..f6910a49 100644 --- a/tests/files/__snapshots__/eslint.test.ts.snap +++ b/tests/files/__snapshots__/eslint.test.ts.snap @@ -90,7 +90,7 @@ exports[`eslint B config file empty 1`] = ` "could-have-hardcore-rules-extend-hardcore", "could-have-eslint-recommended-rules-extend-eslint-recommended", "could-have-unicorn-rules-extend-plugin-unicorn-all", - "current-eslintrc-json-has-only-16-of-the-62-custom-rules-in-repo-checker-eslintrc-json", + "current-eslintrc-json-has-only-16-of-the-64-custom-rules-in-repo-checker-eslintrc-json", ], } `; @@ -142,7 +142,7 @@ exports[`eslint C config file empty for ts project 1`] = ` "could-have-hardcore-rules-extend-hardcore", "could-have-eslint-recommended-rules-extend-eslint-recommended", "could-have-unicorn-rules-extend-plugin-unicorn-all", - "current-eslintrc-json-has-only-0-of-the-62-custom-rules-in-repo-checker-eslintrc-json", + "current-eslintrc-json-has-only-0-of-the-64-custom-rules-in-repo-checker-eslintrc-json", "could-have-hardcore-typescript-rules-extend-hardcore-ts", ], } @@ -196,7 +196,7 @@ exports[`eslint D config file empty for vue ts project 1`] = ` "could-have-hardcore-rules-extend-hardcore", "could-have-eslint-recommended-rules-extend-eslint-recommended", "could-have-unicorn-rules-extend-plugin-unicorn-all", - "current-eslintrc-json-has-only-0-of-the-69-custom-rules-in-repo-checker-eslintrc-json", + "current-eslintrc-json-has-only-0-of-the-71-custom-rules-in-repo-checker-eslintrc-json", "could-have-hardcore-typescript-rules-extend-hardcore-ts", ], } @@ -249,7 +249,7 @@ exports[`eslint E config file empty for tailwind project 1`] = ` "could-have-hardcore-rules-extend-hardcore", "could-have-eslint-recommended-rules-extend-eslint-recommended", "could-have-unicorn-rules-extend-plugin-unicorn-all", - "current-eslintrc-json-has-only-16-of-the-62-custom-rules-in-repo-checker-eslintrc-json", + "current-eslintrc-json-has-only-16-of-the-64-custom-rules-in-repo-checker-eslintrc-json", ], } `; @@ -309,7 +309,7 @@ exports[`eslint F config partial file for js project 1`] = ` "warnings": [ "could-have-hardcore-rules-extend-hardcore", "could-have-unicorn-rules-extend-plugin-unicorn-all", - "current-eslintrc-json-has-only-16-of-the-62-custom-rules-in-repo-checker-eslintrc-json", + "current-eslintrc-json-has-only-16-of-the-64-custom-rules-in-repo-checker-eslintrc-json", ], } `; @@ -368,7 +368,7 @@ exports[`eslint G config partial file for ts project 1`] = ` "warnings": [ "could-have-hardcore-rules-extend-hardcore", "could-have-unicorn-rules-extend-plugin-unicorn-all", - "current-eslintrc-json-has-only-0-of-the-62-custom-rules-in-repo-checker-eslintrc-json", + "current-eslintrc-json-has-only-0-of-the-64-custom-rules-in-repo-checker-eslintrc-json", "could-have-hardcore-typescript-rules-extend-hardcore-ts", ], } @@ -440,7 +440,7 @@ exports[`eslint H config partial file for vue ts project 1`] = ` "warnings": [ "could-have-hardcore-rules-extend-hardcore", "could-have-unicorn-rules-extend-plugin-unicorn-all", - "current-eslintrc-json-has-only-0-of-the-69-custom-rules-in-repo-checker-eslintrc-json", + "current-eslintrc-json-has-only-0-of-the-71-custom-rules-in-repo-checker-eslintrc-json", "could-have-hardcore-typescript-rules-extend-hardcore-ts", ], } @@ -578,7 +578,7 @@ exports[`eslint J config file with no rules 1`] = ` ], "warnings": [ "eslintrc-json-could-have-unicorn-rules-extend-plugin-unicorn-all", - "eslintrc-json-current-eslintrc-json-has-only-16-of-the-62-custom-rules-in-repo-checker-eslintrc-json", + "eslintrc-json-current-eslintrc-json-has-only-16-of-the-64-custom-rules-in-repo-checker-eslintrc-json", ], } `; @@ -654,7 +654,7 @@ exports[`eslint K config file with just rules (no override) 1`] = ` ], "warnings": [ "eslintrc-json-could-have-unicorn-rules-extend-plugin-unicorn-all", - "eslintrc-json-current-eslintrc-json-has-only-17-of-the-62-custom-rules-in-repo-checker-eslintrc-json", + "eslintrc-json-current-eslintrc-json-has-only-17-of-the-64-custom-rules-in-repo-checker-eslintrc-json", ], } `; @@ -839,6 +839,7 @@ exports[`eslint M fix rules in overrides 1`] = ` "error", "always-multiline" ], + "compat/compat": "off", "curly": [ "error", "multi" @@ -881,6 +882,7 @@ exports[`eslint M fix rules in overrides 1`] = ` "always" ], "padding-line-between-statements": "off", + "prefer-destructuring": "off", "prettier/prettier": "off", "putout/putout": "off", "quote-props": [ diff --git a/tests/files/__snapshots__/tailwind.test.ts.snap b/tests/files/__snapshots__/tailwind.test.ts.snap index ce84102e..5ddebfbd 100644 --- a/tests/files/__snapshots__/tailwind.test.ts.snap +++ b/tests/files/__snapshots__/tailwind.test.ts.snap @@ -35,6 +35,7 @@ exports[`tailwind : can detect valid config 1`] = ` }, "failed": [], "fileContent": "/** @type {import('tailwindcss').Config} */ +// eslint-disable-next-line import/unambiguous, import/no-commonjs module.exports = { content: ['public/*.html', './src/**/*.{vue,js,ts,jsx,tsx}'], safelist: [ @@ -48,7 +49,8 @@ module.exports = { } ", "fileName": "", - "originalFileContent": "module.exports = { + "originalFileContent": "// eslint-disable-next-line import/unambiguous, import/no-commonjs +module.exports = { content: ['public/*.html', './src/**/*.{vue,js,ts,jsx,tsx}'], safelist: [ {