diff --git a/.eslintrc.js b/.eslintrc.js index a2008631..34fd7cba 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,40 +1,36 @@ module.exports = { root: true, - parser: '@typescript-eslint/parser', - plugins: ['@typescript-eslint'], + plugins: ['@typescript-eslint', 'prettier', 'promise', 'import', 'jsdoc'], env: { node: true, es6: true }, extends: [ 'eslint:recommended', + 'prettier', + 'plugin:prettier/recommended', + 'plugin:promise/recommended', 'plugin:@typescript-eslint/recommended', - 'prettier' + 'plugin:jsdoc/recommended', + 'plugin:import/errors', + 'plugin:import/warnings', + 'plugin:import/typescript' ], - parserOptions: { - ecmaVersion: 2020, - sourceType: 'module' - }, rules: { - 'block-spacing': ['error'], - 'brace-style': ['error'], - 'comma-dangle': ['error', 'never'], - 'comma-spacing': ['error'], - 'eol-last': ['error'], - indent: ['error', 4, { SwitchCase: 1 }], - 'keyword-spacing': ['error'], - 'max-statements-per-line': ['error'], - 'no-floating-decimal': ['error'], - 'no-multi-spaces': ['error'], - 'no-multiple-empty-lines': ['error', { max: 1 }], - 'no-trailing-spaces': ['error'], - 'one-var': ['error', 'never'], - semi: ['error'], - 'space-before-blocks': ['error'] + '@typescript-eslint/explicit-function-return-type': 'error', + '@typescript-eslint/no-explicit-any': 'warn', + 'import/newline-after-import': 'error', + 'import/order': 'error', + 'promise/no-nesting': 'error', + 'promise/no-new-statics': 'error', + 'promise/no-return-in-finally': 'error', + 'promise/prefer-await-to-callbacks': 'error', + 'promise/prefer-await-to-then': 'error', + 'prefer-arrow-callback': 'error' }, overrides: [ { - files: ['./src/**/*.js', './src/**/*.ts'], + files: ['.js', '.ts'], env: { node: false, browser: true, @@ -44,12 +40,17 @@ module.exports = { cast: 'readonly', PRODUCTION: 'readonly', $scope: 'writable' - }, - rules: { - // Disable these until we have converted the project to TS - '@typescript-eslint/explicit-module-boundary-types': 'off', - '@typescript-eslint/no-explicit-any': 'off' } } - ] + ], + settings: { + 'import/parsers': { + '@typescript-eslint/parser': ['.ts', '.tsx'] + }, + 'import/resolver': { + typescript: { + alwaysTryTypes: true + } + } + } }; diff --git a/.github/.dependabot.yml b/.github/.dependabot.yml new file mode 100644 index 00000000..761758e2 --- /dev/null +++ b/.github/.dependabot.yml @@ -0,0 +1,17 @@ +version: 2 +updates: +# Fetch and update latest `npm` packages +- package-ecosystem: npm + directory: '/' + schedule: + interval: daily + time: '00:00' + open-pull-requests-limit: 10 + reviewers: + - YouKnowBlom + assignees: + - YouKnowBlom + commit-message: + prefix: fix + prefix-development: chore + include: scope