Skip to content

Commit

Permalink
chore: migrate to leancode linters
Browse files Browse the repository at this point in the history
  • Loading branch information
alszczep committed Jul 23, 2024
1 parent 1b504fa commit 028361d
Show file tree
Hide file tree
Showing 6 changed files with 2,180 additions and 195 deletions.
60 changes: 3 additions & 57 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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"
}
},
{
Expand Down
18 changes: 0 additions & 18 deletions .prettierrc

This file was deleted.

3 changes: 3 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const baseConfig = require("@leancodepl/prettier-config")

module.exports = baseConfig
42 changes: 35 additions & 7 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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"
}
Loading

0 comments on commit 028361d

Please sign in to comment.