Skip to content

Commit

Permalink
eslint config upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
rjjaegeraws committed Apr 12, 2024
1 parent b59818b commit 4e4ff56
Show file tree
Hide file tree
Showing 4 changed files with 267 additions and 9 deletions.
8 changes: 0 additions & 8 deletions .eslintignore

This file was deleted.

194 changes: 194 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
import js from "@eslint/js";
import jsdoc from "eslint-plugin-jsdoc";
import typescriptParser from "@typescript-eslint/parser";
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import deprecation from "eslint-plugin-deprecation";
import impt from "eslint-plugin-import";


export default [
{
files: ["src/**/*.ts", "src/**/*.tsx"],
ignores: ['node_modules/**'],
plugins: {
tseslint: typescriptEslint,
deprecation: deprecation,
import: impt,
jsdoc: jsdoc
},
languageOptions: {
parser: typescriptParser,
parserOptions: {
project: ['./tsconfig.eslint.json'],
sourceType: 'module',
},
},
rules: {
"tseslint/adjacent-overload-signatures": "error",
"tseslint/array-type": "off",
"tseslint/await-thenable": "error",
"tseslint/ban-types": "off",
"tseslint/consistent-type-assertions": "error",
"tseslint/dot-notation": "error",
"tseslint/indent": "off",
"deprecation/deprecation": "error",
"tseslint/member-delimiter-style": [
"off",
{
"multiline": {
"delimiter": "none",
"requireLast": "error",
},
"singleline": {
"delimiter": "semi",
"requireLast": "off",
},
},
],
"tseslint/member-ordering": "off",
"tseslint/naming-convention": [
"error",
{
"selector": "variable",
"format": ["camelCase", "UPPER_CASE", "PascalCase"],
"leadingUnderscore": "allow",
},
],
"tseslint/no-empty-function": "error",
"tseslint/no-empty-interface": "error",
"tseslint/no-explicit-any": "off",
"tseslint/no-floating-promises": "error",
"tseslint/no-misused-new": "error",
"tseslint/no-namespace": "off",
"tseslint/no-parameter-properties": "off",
"tseslint/no-this-alias": "error",
"tseslint/no-unnecessary-qualifier": "error",
"tseslint/no-unnecessary-type-assertion": "error",
"tseslint/no-unused-expressions": "off",
"tseslint/no-use-before-define": "off",
"tseslint/no-var-requires": "off",
"tseslint/prefer-for-of": "error",
"tseslint/prefer-function-type": "error",
"tseslint/prefer-namespace-keyword": "error",
"tseslint/quotes": "off",
"tseslint/semi": ["off", null],
"tseslint/triple-slash-reference": [
"error",
{
"path": "always",
"types": "prefer-import",
"lib": "always",
},
],
"tseslint/type-annotation-spacing": "off",
"tseslint/unified-signatures": "error",
"arrow-parens": ["off", "always"],
"brace-style": ["off", "off"],
"comma-dangle": "off",
"complexity": "off",
"constructor-super": "error",
"curly": "error",
"default-case": "error",
"eol-last": "off",
"eqeqeq": ["error", "smart"],
"guard-for-in": "error",
"id-blacklist": "off",
"id-match": "error",
"import/no-deprecated": "error",
"import/no-extraneous-dependencies": "off",
"import/no-internal-modules": "off",
"jsdoc/check-alignment": "error",
"jsdoc/check-indentation": "off",
"jsdoc/newline-after-description": "off",
"linebreak-style": "off",
"max-classes-per-file": "off",
"max-len": "off",
"new-parens": "off",
"newline-per-chained-call": "off",
"no-bitwise": "error",
"no-caller": "error",
"no-cond-assign": "error",
"no-console": "off",
"no-constant-condition": "off",
"no-control-regex": "error",
"no-debugger": "error",
"no-duplicate-case": "error",
"no-duplicate-imports": "error",
"no-empty": ["warn"],
"no-eval": "error",
"no-extra-bind": "error",
"no-extra-semi": "off",
"no-fallthrough": "error",
"no-invalid-regexp": "error",
"no-invalid-this": "off",
"no-irregular-whitespace": "off",
"no-multiple-empty-lines": "off",
"no-new-func": "error",
"no-new-wrappers": "error",
"no-redeclare": "off",
"no-regex-spaces": "error",
"no-return-await": "error",
"no-sequences": "error",
"no-shadow": [
"off",
{
"hoist": "all",
},
],
"no-sparse-arrays": "error",
"no-template-curly-in-string": "error",
"no-throw-literal": "error",
"no-trailing-spaces": "off",
"no-undef-init": "error",
"no-underscore-dangle": "off",
"no-unsafe-finally": "error",
"no-unused-labels": "error",
"no-var": "error",
"object-shorthand": "error",
"one-var": ["error", "never"],
"prefer-arrow/prefer-arrow-functions": "off",
"prefer-const": "error",
"prefer-object-spread": "error",
"quote-props": "off",
"radix": "error",
"react/jsx-curly-spacing": "off",
"react/jsx-equals-spacing": "off",
"react/jsx-wrap-multilines": "off",
"space-before-function-paren": "off",
"space-in-parens": ["off", "never"],
"spaced-comment": [
"error",
"always",
{
"markers": ["/"],
},
],
"unicorn/filename-case": "off",
"use-isnan": "error",
"valid-typeof": "off",
"align": "off",
"ban": "off",
"eofline": "off",
"indent": "off",
"interface-name": "off",
"jsx-no-lambda": "off",
"jsx-no-multiline-js": "off",
"max-line-length": "off",
"member-ordering": "off",
"no-consecutive-blank-lines": "off",
"no-implicit-dependencies": "off",
"no-namespace": "off",
"no-submodule-imports": "off",
"no-trailing-whitespace": "off",
"no-unused-expression": "off",
"no-use-before-declare": "off",
"one-line": "off",
"prefer-conditional-expression": "off",
"quotemark": "off",
"semicolon": "off",
"trailing-comma": "off",
"typedef-whitespace": "off",
"whitespace": "off",
}
}
];
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"@types/node": "20.8.0",
"@typescript-eslint/eslint-plugin": "6.7.3",
"@typescript-eslint/parser": "6.7.3",
"@eslint/eslintrc": "3.0.2",
"@eslint/js": "9.0.0",
"eslint": "8.50.0",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-deprecation": "2.0.0",
Expand All @@ -19,6 +21,7 @@
"eslint-plugin-prefer-arrow": "1.2.3",
"eslint-plugin-react": "7.33.2",
"eslint-plugin-unicorn": "48.0.1",
"prettier": "3.0.3"
"prettier": "3.0.3",
"globals": "15.0.0"
}
}
69 changes: 69 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4e4ff56

Please sign in to comment.