diff --git a/.eslintrc.json b/.eslintrc.json index c47fe3f..2a410d1 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,11 +1,11 @@ { "root": true, "ignorePatterns": ["**/*"], - "plugins": ["@nx", "import", "unused-imports", "prettier"], + "plugins": ["@nx"], + "extends": ["@leancodepl", "@leancodepl/eslint-config"], "overrides": [ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "extends": ["plugin:prettier/recommended", "prettier"], "rules": { "@nx/enforce-module-boundaries": [ "error", @@ -20,61 +20,7 @@ ] } ], - "@nx/dependency-checks": "error", - - "@typescript-eslint/explicit-function-return-type": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/prefer-interface": "off", - "@typescript-eslint/explicit-member-accessibility": "off", - "@typescript-eslint/no-parameter-properties": "off", - "@typescript-eslint/no-empty-function": "off", - "@typescript-eslint/no-unused-vars": "off", - "@typescript-eslint/no-use-before-define": "off", - "@typescript-eslint/no-var-requires": "off", - "@typescript-eslint/camelcase": "off", - "@typescript-eslint/no-empty-interface": "off", - "@typescript-eslint/no-inferrable-types": "off", - "@typescript-eslint/explicit-module-boundary-types": "off", - "@typescript-eslint/ban-types": "off", - - "arrow-body-style": "error", - "no-useless-rename": "error", - - "prettier/prettier": "warn", - - "import/first": "error", - "import/newline-after-import": "error", - "import/no-anonymous-default-export": "error", - "import/no-duplicates": "error", - "import/no-named-default": "error", - "import/no-self-import": "error", - "import/no-useless-path-segments": [ - "error", - { - "noUselessIndex": true - } - ], - "import/order": [ - "error", - { - "groups": [["builtin", "external"], "internal", ["index", "sibling", "parent"], "object"], - "pathGroups": [ - { - "pattern": "react", - "group": "external", - "position": "before" - } - ], - "newlines-between": "never", - "alphabetize": { "order": "asc", "caseInsensitive": true } - } - ], - - "unused-imports/no-unused-imports-ts": "error", - "unused-imports/no-unused-vars-ts": [ - "warn", - { "vars": "all", "varsIgnorePattern": "^_", "args": "after-used", "argsIgnorePattern": "^_" } - ] + "@nx/dependency-checks": "error" } }, { diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index e679997..0000000 --- a/.prettierrc +++ /dev/null @@ -1,18 +0,0 @@ -{ - "printWidth": 120, - "useTabs": false, - "arrowParens": "avoid", - "trailingComma": "all", - "semicolons": false, - "tabWidth": 2, - "endOfLine": "lf", - "overrides": [ - { - "files": ["*.json", ".prettierrc", ".eslintrc", ".yml"], - "options": { - "tabWidth": 2 - } - } - ], - "proseWrap": "always" -} diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..4dc5bdd --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,3 @@ +const baseConfig = require("@leancodepl/prettier-config") + +module.exports = baseConfig diff --git a/.vscode/settings.json b/.vscode/settings.json index 67e2fcb..d04ed4d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,13 +4,6 @@ "**/obj": true }, - "[typescript]": { - "editor.defaultFormatter": "dbaeumer.vscode-eslint", - "editor.codeActionsOnSave": { - "source.fixAll": "explicit" - } - }, - "typescript.preferences.importModuleSpecifier": "project-relative", "typescript.preferences.quoteStyle": "double", "typescript.preferences.useAliasesForRenames": false, @@ -24,5 +17,40 @@ "eslint.format.enable": true, "eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"], + "eslint.workingDirectories": [ + { + "mode": "auto" + } + ], + + "[javascript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.codeActionsOnSave": { + "source.fixAll": "explicit", + "source.fixAll.eslint": "explicit" + } + }, + "[javascriptreact]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.codeActionsOnSave": { + "source.fixAll": "explicit", + "source.fixAll.eslint": "explicit" + } + }, + "[typescript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.codeActionsOnSave": { + "source.fixAll": "explicit", + "source.fixAll.eslint": "explicit" + } + }, + "[typescriptreact]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.codeActionsOnSave": { + "source.fixAll": "explicit", + "source.fixAll.eslint": "explicit" + } + }, + "typescript.tsdk": "node_modules/typescript/lib" } diff --git a/package-lock.json b/package-lock.json index 017302d..e055d70 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,8 +35,8 @@ "devDependencies": { "@commitlint/cli": "^17.7.1", "@commitlint/config-conventional": "^17.7.0", - "@leancodepl/eslint-config": "^7.4.0", - "@leancodepl/prettier-config": "^7.4.0", + "@leancodepl/eslint-config": "7.4.0", + "@leancodepl/prettier-config": "7.4.0", "@nx/eslint": "19.0.4", "@nx/eslint-plugin": "19.0.4", "@nx/jest": "19.0.4", diff --git a/package.json b/package.json index eb057e3..45c1178 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,8 @@ "devDependencies": { "@commitlint/cli": "^17.7.1", "@commitlint/config-conventional": "^17.7.0", + "@leancodepl/eslint-config": "7.4.0", + "@leancodepl/prettier-config": "7.4.0", "@nx/eslint": "19.0.4", "@nx/eslint-plugin": "19.0.4", "@nx/jest": "19.0.4",