diff --git a/.eslintrc.js b/.eslintrc.js index beddc98114c6ef70864a1ab94d95b13170e516d5..7e59c443aa4b31e15555b88b11503cd8b171afff 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -2,12 +2,18 @@ module.exports = { env: { node: true, }, - extends: ['airbnb-base', 'prettier'], + extends: [ + 'airbnb-base', + 'plugin:@typescript-eslint/recommended', + 'prettier', + 'prettier/@typescript-eslint', + ], parser: '@typescript-eslint/parser', parserOptions: { ecmaVersion: 9, + project: './tsconfig.json', }, - plugins: ['import', 'promise'], + plugins: ['import', 'promise', '@typescript-eslint'], rules: { 'require-await': 'error', 'no-use-before-define': 0, @@ -25,7 +31,26 @@ module.exports = { 'promise/no-callback-in-promise': 'warn', 'promise/avoid-new': 'warn', 'no-underscore-dangle': 0, + + // TODO: fix lint + '@typescript-eslint/camelcase': 'off', // disabled until ?? + '@typescript-eslint/no-var-requires': 'off', // disable until all files converted to typescript + '@typescript-eslint/no-use-before-define': 'off', // disable until all files converted to typescript + '@typescript-eslint/explicit-member-accessibility': 0, + '@typescript-eslint/explicit-function-return-type': 0, + '@typescript-eslint/interface-name-prefix': 0, + '@typescript-eslint/no-explicit-any': 0, + '@typescript-eslint/no-non-null-assertion': 0, }, + overrides: [ + { + files: ['*.spec.js', '*.spec.ts'], + rules: { + 'global-require': 0, + 'prefer-promise-reject-errors': 0, + }, + }, + ], settings: { 'import/resolver': { node: { diff --git a/.tslintrc.js b/.tslintrc.js deleted file mode 100644 index 0465d5507ae1f0540acc757637cea859635c9989..0000000000000000000000000000000000000000 --- a/.tslintrc.js +++ /dev/null @@ -1,37 +0,0 @@ -const base = require('./.eslintrc'); - -module.exports = { - ...base, - extends: [ - 'airbnb-base', - 'plugin:@typescript-eslint/recommended', - 'prettier', - 'prettier/@typescript-eslint', - ], - parserOptions: { - project: './tsconfig.json', - }, - plugins: [...base.plugins, '@typescript-eslint'], - rules: { - ...base.rules, - - // TODO: fix lint - '@typescript-eslint/camelcase': 'off', // disabled until ?? - '@typescript-eslint/no-var-requires': 'off', // disable until all files converted to typescript - '@typescript-eslint/no-use-before-define': 'off', // disable until all files converted to typescript - '@typescript-eslint/explicit-member-accessibility': 0, - '@typescript-eslint/explicit-function-return-type': 0, - '@typescript-eslint/interface-name-prefix': 0, - '@typescript-eslint/no-explicit-any': 0, - '@typescript-eslint/no-non-null-assertion': 0, - }, - overrides: [ - { - files: ['*.spec.js', '*.spec.ts'], - rules: { - 'global-require': 0, - 'prefer-promise-reject-errors': 0, - }, - }, - ], -}; diff --git a/.vscode/settings.json b/.vscode/settings.json index f1f71cbed76cba333ddd823e8872345962f2625a..eaa55322bf9de5d2c2abb5c5da32b881536df9ed 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,7 +3,7 @@ "javascript", { "language": "typescript", "autoFix": true } ], - "eslint.options": { "configFile": ".tslintrc.js" }, + "eslint.options": { "configFile": ".eslintrc.js" }, "[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, diff --git a/package.json b/package.json index 3ed85117798ba1af14d297be6eef430a669aa66c..d50e87b34bdcde413aad29af4c5d9181b6f6a1d2 100644 --- a/package.json +++ b/package.json @@ -13,12 +13,8 @@ "copy-static-files": "copyfiles -u 1 lib/**/*.json lib/**/*.py dist/", "create-json-schema": "node bin/create-json-schema.js && prettier --write \"renovate-schema.json\"", "debug": "babel-node --inspect-brk --extensions \".ts,.js\" -- lib/renovate.ts", - "eslint": "run-s eslint:*", - "eslint:js": "eslint lib test --ext .js", - "eslint:ts": "eslint -c .tslintrc.js lib test --ext .ts", - "eslint-fix": "run-s eslint-fix:*", - "eslint-fix:js": "eslint --fix lib test --ext .js", - "eslint-fix:ts": "eslint -c .tslintrc.js --fix lib test --ext .ts", + "eslint": "eslint --ext .js,.ts lib/ test/", + "eslint-fix": "eslint --ext .js,.ts --fix lib/ test/", "jest": "yarn clean-cache && cross-env NODE_ENV=test LOG_LEVEL=fatal jest", "jest-debug": "cross-env NODE_ENV=test LOG_LEVEL=fatal node --inspect-brk node_modules/jest/bin/jest.js", "jest-silent": "yarn jest --reporters jest-silent-reporter",