Skip to content

Commit

Permalink
chore(eslint): use eslint-config
Browse files Browse the repository at this point in the history
- install package @boehringer-ingelheim/eslint-config@1.0.0
- uninstall package @typescript-eslint/eslint-plugin@5.51.0
- uninstall package @typescript-eslint/parser@5.51.0
- uninstall package eslint-import-resolver-typescript@3.5.3
- uninstall package eslint-plugin-import@2.27.5
- uninstall package eslint-plugin-jsx-a11y@6.7.1
- uninstall package eslint-plugin-playwright@0.12.0
- uninstall package eslint-plugin-react@7.32.2
- uninstall package eslint-plugin-react-hooks@4.6.0
- uninstall package eslint-plugin-sonarjs@0.18.0
- uninstall package eslint-plugin-sort-keys-fix@1.1.2
- uninstall package eslint-plugin-typescript-sort-keys@2.1.0
- update eslint configuration
  • Loading branch information
SimonGolms committed Feb 8, 2023
1 parent 5b94c30 commit 8eb642f
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 293 deletions.
122 changes: 3 additions & 119 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,69 +6,18 @@ module.exports = {
worker: true,
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:@typescript-eslint/strict",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:import/recommended",
"plugin:import/typescript",
"plugin:jsx-a11y/recommended",
"plugin:playwright/playwright-test",
"plugin:sonarjs/recommended",
"plugin:typescript-sort-keys/recommended",
"@boehringer-ingelheim/eslint-config/base/strict",
"@boehringer-ingelheim/eslint-config/react",
"@boehringer-ingelheim/eslint-config/playwright",
// HINT: prettier must be the last extension to work
"plugin:prettier/recommended",
],
ignorePatterns: ["build", "dev-dist", "dist", "docker", "node_modules", "openshift", "public"],
overrides: [
{
files: ["*.ts", "*.tsx"],
rules: {
"no-undef": "off",
"no-unused-vars": "off",
},
},
],
parser: "@typescript-eslint/parser",
parserOptions: {
project: ["./tsconfig.json"],
tsconfigRootDir: __dirname,
},
plugins: [
"@typescript-eslint",
"jsx-a11y",
"react-hooks",
"react",
"sonarjs",
"sort-keys-fix",
"typescript-sort-keys",
// HINT: prettier must be the last plugin to work
"prettier",
],
rules: {
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
"@typescript-eslint/no-floating-promises": ["error", { ignoreVoid: true }],
"@typescript-eslint/no-misused-promises": [
"error",
{
checksVoidReturn: false,
},
],
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
varsIgnorePattern: "^_",
},
],
"@typescript-eslint/sort-type-union-intersection-members": "error",
camelcase: "warn",
curly: "error",
"import/no-cycle": "error",
"import/no-unused-modules": [
"error",
{
Expand All @@ -84,70 +33,5 @@ module.exports = {
unusedExports: true,
},
],
"import/order": [
"error",
{
alphabetize: {
caseInsensitive: true,
order: "asc",
orderImportKind: "asc",
},
pathGroups: [
{
group: "external",
pattern: "react",
position: "before",
},
],
pathGroupsExcludedImportTypes: ["react"],
},
],
"import/prefer-default-export": "off",
"no-console": ["warn", { allow: ["warn", "error"] }],
"playwright/prefer-to-be": "error",
"playwright/prefer-to-have-length": "error",
"playwright/require-top-level-describe": "error",
"prettier/prettier": "error",
"react/jsx-sort-props": [
"error",
{
callbacksLast: true,
ignoreCase: true,
noSortAlphabetically: false,
reservedFirst: true,
shorthandFirst: false,
shorthandLast: false,
},
],
"react/sort-default-props": "error",
"react-hooks/exhaustive-deps": "error",
"react-hooks/rules-of-hooks": "error",
"sort-imports": [
"error",
{
ignoreCase: true,
ignoreDeclarationSort: true,
ignoreMemberSort: false,
},
],
// Required to fix sort-keys automatically, since this is not done by default.
"sort-keys-fix/sort-keys-fix": [
"error",
"asc",
{
caseSensitive: false,
natural: true,
},
],
},
settings: {
"import/resolver": {
typescript: {
alwaysTryTypes: true,
},
},
react: {
version: "detect",
},
},
};

0 comments on commit 8eb642f

Please sign in to comment.