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-05-18 12:33:44 +00:00
|
|
|
'plugin:jest/recommended',
|
|
|
|
'plugin:jest/style',
|
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,
|
2020-03-24 06:17:59 +00:00
|
|
|
project: ['./tsconfig.lint.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,
|
2020-08-19 04:46:00 +00:00
|
|
|
// 'no-unused-vars': 2,
|
2019-07-08 13:58:12 +00:00
|
|
|
|
2020-05-01 16:03:48 +00:00
|
|
|
'sort-imports': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
ignoreCase: false,
|
|
|
|
ignoreDeclarationSort: true, // conflicts with our other import ordering rules
|
|
|
|
ignoreMemberSort: false,
|
|
|
|
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
'import/order': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
alphabetize: {
|
|
|
|
order: 'asc',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
|
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,
|
2020-04-09 10:47:48 +00:00
|
|
|
'@typescript-eslint/no-floating-promises': 2,
|
2019-07-08 13:58:12 +00:00
|
|
|
'@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
|
|
|
},
|
2020-08-10 14:18:08 +00:00
|
|
|
],
|
2020-08-31 11:13:02 +00:00
|
|
|
'@typescript-eslint/prefer-optional-chain': 2,
|
2020-07-18 06:42:32 +00:00
|
|
|
'@typescript-eslint/prefer-nullish-coalescing': 2,
|
2020-03-17 11:15:22 +00:00
|
|
|
curly: [2, 'all'],
|
2020-07-22 05:45:57 +00:00
|
|
|
'require-await': 2,
|
2020-08-10 14:18:08 +00:00
|
|
|
// next 2 rules disabled due to https://github.com/microsoft/TypeScript/issues/20024
|
|
|
|
'@typescript-eslint/no-unsafe-assignment': 0,
|
|
|
|
'@typescript-eslint/no-unsafe-member-access': 0,
|
|
|
|
|
|
|
|
// TODO: fix me
|
|
|
|
'@typescript-eslint/no-unsafe-return': 0,
|
|
|
|
'@typescript-eslint/no-unsafe-call': 0,
|
|
|
|
|
|
|
|
'@typescript-eslint/restrict-template-expressions': [
|
|
|
|
1,
|
|
|
|
{ allowNumber: true, allowBoolean: true },
|
|
|
|
],
|
2020-08-31 11:13:02 +00:00
|
|
|
'@typescript-eslint/restrict-plus-operands': 2,
|
2020-08-10 14:18:08 +00:00
|
|
|
|
2020-08-31 11:13:02 +00:00
|
|
|
'@typescript-eslint/naming-convention': 2,
|
2020-08-10 14:18:08 +00:00
|
|
|
|
2020-08-31 11:13:02 +00:00
|
|
|
'@typescript-eslint/unbound-method': 2,
|
|
|
|
'@typescript-eslint/ban-types': 2,
|
2019-07-17 08:14:56 +00:00
|
|
|
},
|
2020-03-02 11:06:16 +00:00
|
|
|
settings: {
|
2020-08-19 04:46:00 +00:00
|
|
|
'import/parsers': {
|
|
|
|
'@typescript-eslint/parser': ['.ts'],
|
|
|
|
},
|
2020-03-02 11:06:16 +00:00
|
|
|
},
|
2019-11-20 07:55:53 +00:00
|
|
|
overrides: [
|
|
|
|
{
|
2020-09-07 07:54:07 +00:00
|
|
|
files: ['**/*.spec.ts', 'test/**'],
|
2020-02-04 09:37:00 +00:00
|
|
|
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,
|
2020-09-07 07:54:07 +00:00
|
|
|
|
|
|
|
'jest/valid-title': [0, { ignoreTypeOfDescribeName: true }],
|
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,
|
2020-08-19 04:46:00 +00:00
|
|
|
'@typescript-eslint/explicit-module-boundary-types': 0,
|
|
|
|
'@typescript-eslint/restrict-template-expressions': 0,
|
2020-03-11 09:11:01 +00:00
|
|
|
},
|
|
|
|
},
|
2019-11-20 07:55:53 +00:00
|
|
|
],
|
2017-01-10 21:28:22 +00:00
|
|
|
};
|