Skip to content

Commit

Permalink
fix: update some rules
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaStevens committed Mar 25, 2024
1 parent a58af56 commit 5c9a858
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 25 deletions.
1 change: 1 addition & 0 deletions src/common/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ export const typescriptDeclarationFiles = [
];
export const jsxFiles = [`**/*{${jsxExtensions.join(",")}}`];
export const commonJsFiles = [`**/*{${commonJsExtensions.join(",")}}`];
export const jsFiles = [`**/*{${jsExtensions.join(",")}}`];

export const testFiles = ["{test,tests}/**/*", "**/*.{spec,test}.*"];
12 changes: 11 additions & 1 deletion src/configs/common-overrides.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type Linter } from "eslint";

import { jsxFiles, testFiles } from "~/files";
import { jsFiles, jsxFiles, testFiles } from "~/files";

export default {
overrides: [
Expand All @@ -19,6 +19,16 @@ export default {
files: testFiles,
extends: ["@rebeccastevens/eslint-config/test"],
},
{
files: jsFiles,
extends: [
"plugin:@typescript-eslint/disable-type-checked",
"plugin:functional/disable-type-checked",
],
parserOptions: {
project: false,
},
},
{
files: jsxFiles,
parserOptions: {
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/functional.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ export const settings: Linter.Config = {
ignoreIdentifierPattern: ["^mutable", "^m_"],
},
],
"functional/no-mixed-types": "off",
"functional/functional-parameters": "off",
"functional/prefer-immutable-types": [
"warn",
{
Expand Down
15 changes: 2 additions & 13 deletions src/plugins/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,7 @@ export const settings: Linter.Config = {
"import/dynamic-import-chunkname": "off",
"import/export": "error",
"import/exports-last": "off",
"import/extensions": [
"error",
"always",
{
js: "never",
ts: "never",
cts: "never",
cjs: "never",
mts: "always",
mjs: "always",
json: "always",
},
],
"import/extensions": "off",
"import/first": "error",
"import/group-exports": "off",
"import/max-dependencies": [
Expand Down Expand Up @@ -78,6 +66,7 @@ export const settings: Linter.Config = {
"**/rollup.config.{js,cjs,mjs,ts}",
"**/rollup.config.*.{js,cjs,mjs,ts}",
"**/vite.config.{js,cjs,mjs,ts}",
"**/vitest.config.{js,cjs,mjs,ts}",
"**/vue.config.{js,cjs,mjs,ts}",
"**/webpack.config.{js,cjs,mjs,ts}",
"**/webpack.config.*.{js,cjs,mjs,ts}",
Expand Down
13 changes: 12 additions & 1 deletion src/plugins/jsdoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,18 @@ export const settings: Linter.Config = {
"jsdoc/check-property-names": "error",
"jsdoc/check-types": "error",
"jsdoc/check-values": "error",
"jsdoc/no-bad-blocks": "warn",
"jsdoc/no-bad-blocks": [
"error",
{
ignore: [
"ts-check",
"ts-expect-error",
"ts-ignore",
"ts-nocheck",
"vue-ignore",
],
},
],
"jsdoc/no-defaults": "warn",
"jsdoc/require-asterisk-prefix": "error",
"jsdoc/require-description": "warn",
Expand Down
41 changes: 32 additions & 9 deletions src/plugins/markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,55 @@ export const settings: Linter.Config = {
"plugin:functional/off",
],
rules: {
"@typescript-eslint/consistent-generic-constructors": "off",
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-expressions": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/prefer-function-type": "off",
"dot-notation": "off",
"import/extensions": "off",
"import/newline-after-import": "off",
"import/no-unresolved": "off",
"init-declarations": "off",
"jsdoc/require-jsdoc": "off",
"n/handle-callback-err": "off",
"no-alert": "off",
"no-console": "off",
"no-empty-function": "off",
"no-empty": "off",
"no-invalid-this": "off",
"no-labels": "off",
"no-lone-blocks": "off",
"no-restricted-syntax": "off",
"no-throw-literal": "off",
"no-undef": "off",
"no-unused-expressions": "off",
"no-unused-labels": "off",
"no-unused-vars": "off",
"no-useless-return": "off",
"node/prefer-global/process": "off",
"prefer-const": "off",
"prettier/prettier": "off",
"sonarjs/no-extra-arguments": "off",
"sonarjs/no-unused-collection": "off",
"style/comma-dangle": "off",
"style/eol-last": "off",
"ts/consistent-type-imports": "off",
"ts/no-namespace": "off",
"ts/no-redeclare": "off",
"ts/no-require-imports": "off",
"ts/no-unused-vars": "off",
"ts/no-use-before-define": "off",
"ts/no-var-requires": "off",
"unicode-bom": "off",
"unicorn/prefer-optional-catch-binding": "off",
"unicorn/prefer-top-level-await": "off",
"unicorn/switch-case-braces": "off",
"no-console": "off",
"no-empty": "off",
"no-invalid-this": "off",
"no-undef": "off",
"no-useless-return": "off",
"dot-notation": "off",
"no-empty-function": "off",
"no-throw-literal": "off",
"no-unused-vars": "off",
"unused-imports/no-unused-imports": "off",
"unused-imports/no-unused-vars": "off",
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/sonarjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const settings: Linter.Config = {

rules: {
"sonarjs/cognitive-complexity": "off",
"sonarjs/no-duplicate-string": ["error", { threshold: 5 }],
"sonarjs/no-duplicate-string": "off",
"sonarjs/no-small-switch": "off",
"sonarjs/no-useless-cast": "off",
"sonarjs/max-switch-cases": "off",
Expand Down
6 changes: 6 additions & 0 deletions src/plugins/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ export const settings: Linter.Config = {
ignoreVoidOperator: true,
},
],
"@typescript-eslint/no-empty-interface": [
"error",
{
allowSingleExtends: true,
},
],
"@typescript-eslint/no-extra-parens": [
"error",
"all",
Expand Down

0 comments on commit 5c9a858

Please sign in to comment.