2017-01-10 21:28:22 +00:00
|
|
|
module.exports = {
|
2020-02-04 09:37:00 +00:00
|
|
|
root: true,
|
2017-10-01 05:06:06 +00:00
|
|
|
env: {
|
|
|
|
node: true,
|
|
|
|
},
|
2019-07-08 13:58:12 +00:00
|
|
|
extends: [
|
2019-07-10 08:41:12 +00:00
|
|
|
'airbnb-typescript/base',
|
2020-03-02 11:06:16 +00:00
|
|
|
'plugin:import/errors',
|
|
|
|
'plugin:import/warnings',
|
|
|
|
'plugin:import/typescript',
|
2020-02-12 09:22:38 +00:00
|
|
|
// https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin/src/configs
|
|
|
|
'plugin:@typescript-eslint/eslint-recommended',
|
2020-02-04 09:37:00 +00:00
|
|
|
'plugin:@typescript-eslint/recommended',
|
2020-02-05 18:17:20 +00:00
|
|
|
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
2020-02-04 09:37:00 +00:00
|
|
|
'plugin:promise/recommended',
|
2019-07-08 13:58:12 +00:00
|
|
|
'prettier',
|
|
|
|
'prettier/@typescript-eslint',
|
|
|
|
],
|
2019-04-26 10:59:51 +00:00
|
|
|
parserOptions: {
|
2019-05-21 15:23:30 +00:00
|
|
|
ecmaVersion: 9,
|
2020-02-04 09:37:00 +00:00
|
|
|
tsconfigRootDir: __dirname,
|
|
|
|
project: ['./tsconfig.json'],
|
2020-03-06 08:31:47 +00:00
|
|
|
extraFileExtensions: ['.mjs'],
|
2019-04-26 10:59:51 +00:00
|
|
|
},
|
2017-10-01 05:06:06 +00:00
|
|
|
rules: {
|
2020-02-04 09:37:00 +00:00
|
|
|
/*
|
|
|
|
* checks done by typescript.
|
|
|
|
*
|
|
|
|
* https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/FAQ.md#eslint-plugin-import
|
|
|
|
*/
|
|
|
|
'import/default': 0,
|
|
|
|
'import/named': 0,
|
|
|
|
'import/namespace': 0,
|
|
|
|
'import/no-named-as-default-member': 0,
|
|
|
|
|
|
|
|
// other rules
|
2019-07-23 12:39:15 +00:00
|
|
|
'import/prefer-default-export': 0, // no benefit
|
2017-10-01 05:06:06 +00:00
|
|
|
'no-restricted-syntax': 0,
|
|
|
|
'no-await-in-loop': 0,
|
2020-02-04 09:37:00 +00:00
|
|
|
'prefer-destructuring': 0,
|
|
|
|
'prefer-template': 0,
|
2019-05-20 13:08:18 +00:00
|
|
|
'no-underscore-dangle': 0,
|
2019-07-08 13:58:12 +00:00
|
|
|
|
2020-02-04 09:37:00 +00:00
|
|
|
// Makes no sense to allow type inferrence for expression parameters, but require typing the response
|
|
|
|
'@typescript-eslint/explicit-function-return-type': [
|
|
|
|
'error',
|
|
|
|
{ allowExpressions: true, allowTypedFunctionExpressions: true },
|
|
|
|
],
|
2019-11-26 15:13:07 +00:00
|
|
|
|
2019-07-08 13:58:12 +00:00
|
|
|
// TODO: fix lint
|
2020-02-04 09:37:00 +00:00
|
|
|
'@typescript-eslint/camelcase': 0, // disabled until ??
|
2019-07-08 13:58:12 +00:00
|
|
|
'@typescript-eslint/no-explicit-any': 0,
|
|
|
|
'@typescript-eslint/no-non-null-assertion': 0,
|
2019-07-17 08:14:56 +00:00
|
|
|
'@typescript-eslint/no-unused-vars': [
|
2020-02-04 09:37:00 +00:00
|
|
|
2,
|
2019-07-17 08:14:56 +00:00
|
|
|
{
|
|
|
|
vars: 'all',
|
|
|
|
args: 'none',
|
|
|
|
ignoreRestSiblings: false,
|
2019-07-08 13:58:12 +00:00
|
|
|
},
|
2019-07-17 08:14:56 +00:00
|
|
|
], // disable until proper interfaced api
|
|
|
|
},
|
2020-03-02 11:06:16 +00:00
|
|
|
settings: {
|
|
|
|
// https://github.com/benmosher/eslint-plugin-import/issues/1618
|
|
|
|
'import/internal-regex': '^type\\-fest$',
|
|
|
|
},
|
2019-11-20 07:55:53 +00:00
|
|
|
overrides: [
|
|
|
|
{
|
2020-02-04 09:37:00 +00:00
|
|
|
files: ['**/*.spec.ts'],
|
|
|
|
env: {
|
|
|
|
jest: true,
|
|
|
|
},
|
2019-11-20 07:55:53 +00:00
|
|
|
rules: {
|
2020-02-04 09:37:00 +00:00
|
|
|
'prefer-destructuring': 0,
|
|
|
|
'prefer-promise-reject-errors': 0,
|
|
|
|
'import/no-dynamic-require': 0,
|
|
|
|
'global-require': 0,
|
|
|
|
|
2019-11-20 07:55:53 +00:00
|
|
|
'@typescript-eslint/no-var-requires': 0,
|
2020-02-04 09:37:00 +00:00
|
|
|
'@typescript-eslint/no-object-literal-type-assertion': 0,
|
2019-11-20 07:55:53 +00:00
|
|
|
'@typescript-eslint/explicit-function-return-type': 0,
|
2020-02-05 18:17:20 +00:00
|
|
|
'@typescript-eslint/unbound-method': 0,
|
2019-11-20 07:55:53 +00:00
|
|
|
},
|
|
|
|
},
|
2020-03-11 09:11:01 +00:00
|
|
|
{
|
|
|
|
files: ['**/*.mjs'],
|
|
|
|
|
|
|
|
rules: {
|
|
|
|
'@typescript-eslint/explicit-function-return-type': 0,
|
|
|
|
},
|
|
|
|
},
|
2019-11-20 07:55:53 +00:00
|
|
|
],
|
2017-01-10 21:28:22 +00:00
|
|
|
};
|