diff --git a/apps/api/.eslintrc.js b/apps/api/.eslintrc.js index de2f43a..cf29d53 100644 --- a/apps/api/.eslintrc.js +++ b/apps/api/.eslintrc.js @@ -1,6 +1,61 @@ -const base = require('eslint-config-custom/_base'); - module.exports = { - ...base(__dirname), - extends: ['custom/nest'], + parser: '@typescript-eslint/parser', + parserOptions: { + project: 'tsconfig.json', + tsconfigRootDir: __dirname, + sourceType: 'module', + }, + plugins: ['@typescript-eslint/eslint-plugin', 'prettier', 'unicorn'], + extends: [ + 'prettier', + 'airbnb-base', + 'airbnb-typescript/base', + 'plugin:@typescript-eslint/recommended', + 'plugin:unicorn/recommended', + ], + root: true, + env: { + node: true, + jest: true, + }, + ignorePatterns: ['.eslintrc.js'], + rules: { + '@typescript-eslint/interface-name-prefix': 'off', + '@typescript-eslint/explicit-function-return-type': 'off', + '@typescript-eslint/explicit-module-boundary-types': 'off', + '@typescript-eslint/no-explicit-any': 'off', + + 'linebreak-style': ['error', 'windows'], + 'comma-dangle': 'off', + '@typescript-eslint/comma-dangle': ['off'], + + 'import/extensions': 'off', + 'object-curly-newline': [ + 'warn', + { + ObjectExpression: 'always', + ObjectPattern: { multiline: true }, + ImportDeclaration: 'never', + ExportDeclaration: { multiline: true, minProperties: 3 }, + }, + ], + 'lines-between-class-members': 'off', + '@typescript-eslint/lines-between-class-members': ['off'], + indent: 'off', + '@typescript-eslint/indent': ['off'], + + 'newline-before-return': 'warn', + '@typescript-eslint/consistent-type-imports': 'error', + // Airbnb prefers forEach + 'unicorn/no-array-for-each': 'off', + 'unicorn/prevent-abbreviations': 'off', + 'unicorn/no-null': 'off', + 'unicorn/prefer-node-protocol': 'off', + 'unicorn/no-array-reduce': 'off', + 'unicorn/prefer-module': 'off', + 'unicorn/text-encoding-identifier-case': 'off', + 'import/no-unresolved': 'warn', + 'import/prefer-default-export': 'off', + 'class-methods-use-this': 'off', + }, }; diff --git a/apps/api/package.json b/apps/api/package.json index ca0ac0c..7aae10f 100644 --- a/apps/api/package.json +++ b/apps/api/package.json @@ -46,8 +46,15 @@ "@types/ldap-authentication": "^2.2.0", "@types/node": "^16.0.0", "@types/supertest": "^2.0.11", + "@typescript-eslint/eslint-plugin": "^5.0.0", + "@typescript-eslint/parser": "^5.0.0", "eslint": "^8.28.0", - "eslint-config-custom": "*", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-config-airbnb-typescript": "^17.0.0", + "eslint-config-prettier": "^8.3.0", + "eslint-plugin-import": "^2.26.0", + "eslint-plugin-prettier": "^4.0.0", + "eslint-plugin-unicorn": "^43.0.2", "jest": "28.1.2", "prettier": "^2.3.2", "source-map-support": "^0.5.20", diff --git a/packages/eslint-config-custom/_base.js b/packages/eslint-config-custom/_base.js deleted file mode 100644 index 983f0e6..0000000 --- a/packages/eslint-config-custom/_base.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = function (dirname) { - return { - root: true, - parserOptions: { - project: 'tsconfig.json', - tsconfigRootDir: dirname, - sourceType: 'module', - }, - }; -}; diff --git a/packages/eslint-config-custom/common.js b/packages/eslint-config-custom/common.js deleted file mode 100644 index 598d8b3..0000000 --- a/packages/eslint-config-custom/common.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - extends: ['turbo', 'prettier'], -}; diff --git a/packages/eslint-config-custom/nest.js b/packages/eslint-config-custom/nest.js deleted file mode 100644 index a537fa3..0000000 --- a/packages/eslint-config-custom/nest.js +++ /dev/null @@ -1,55 +0,0 @@ -module.exports = { - parser: '@typescript-eslint/parser', - plugins: ['@typescript-eslint/eslint-plugin', 'prettier', 'unicorn'], - extends: [ - 'prettier', - 'airbnb-base', - 'airbnb-typescript/base', - 'plugin:@typescript-eslint/recommended', - 'plugin:unicorn/recommended', - ], - env: { - node: true, - jest: true, - }, - ignorePatterns: ['.eslintrc.js'], - rules: { - '@typescript-eslint/interface-name-prefix': 'off', - '@typescript-eslint/explicit-function-return-type': 'off', - '@typescript-eslint/explicit-module-boundary-types': 'off', - '@typescript-eslint/no-explicit-any': 'off', - - 'linebreak-style': ['error', 'windows'], - 'comma-dangle': 'off', - '@typescript-eslint/comma-dangle': ['off'], - - 'import/extensions': 'off', - 'object-curly-newline': [ - 'warn', - { - ObjectExpression: 'always', - ObjectPattern: { multiline: true }, - ImportDeclaration: 'never', - ExportDeclaration: { multiline: true, minProperties: 3 }, - }, - ], - 'lines-between-class-members': 'off', - '@typescript-eslint/lines-between-class-members': ['off'], - indent: 'off', - '@typescript-eslint/indent': ['off'], - - 'newline-before-return': 'warn', - '@typescript-eslint/consistent-type-imports': 'error', - // Airbnb prefers forEach - 'unicorn/no-array-for-each': 'off', - 'unicorn/prevent-abbreviations': 'off', - 'unicorn/no-null': 'off', - 'unicorn/prefer-node-protocol': 'off', - 'unicorn/no-array-reduce': 'off', - 'unicorn/prefer-module': 'off', - 'unicorn/text-encoding-identifier-case': 'off', - 'import/no-unresolved': 'warn', - 'import/prefer-default-export': 'off', - 'class-methods-use-this': 'off', - }, -}; diff --git a/packages/eslint-config-custom/package.json b/packages/eslint-config-custom/package.json deleted file mode 100644 index 65f919f..0000000 --- a/packages/eslint-config-custom/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "eslint-config-custom", - "version": "0.0.0", - "main": "index.js", - "license": "MIT", - "dependencies": { - "@typescript-eslint/eslint-plugin": "^5.30.7", - "@typescript-eslint/parser": "^5.30.7", - "eslint": "^8.28.0", - "eslint-config-airbnb": "^19.0.4", - "eslint-config-airbnb-base": "^15.0.0", - "eslint-config-airbnb-typescript": "^17.0.0", - "eslint-config-next": "13.0.0", - "eslint-config-prettier": "^8.3.0", - "eslint-config-turbo": "latest", - "eslint-plugin-import": "^2.26.0", - "eslint-plugin-prettier": "^4.2.1", - "eslint-plugin-react": "7.31.8", - "eslint-plugin-testing-library": "^5.9.1", - "eslint-plugin-unicorn": "^45.0.0" - }, - "devDependencies": { - "typescript": "^4.7.4" - }, - "publishConfig": { - "access": "public" - } -}