forked from strapi/strapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.back.typescript.js
36 lines (35 loc) · 1.37 KB
/
.eslintrc.back.typescript.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
'use strict';
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.eslint.json',
},
plugins: ['@typescript-eslint'],
extends: ['@strapi/eslint-config/typescript'],
globals: {
strapi: false,
},
rules: {
// Instead of extending (which includes values that interfere with this configuration), only take the rules field
...require('./.eslintrc.back.js').rules,
'import/no-extraneous-dependencies': ['error', { devDependencies: ['**/*.test.ts'] }],
// TODO: The following rules from @strapi/eslint-config/typescript are disabled because they're causing problems we need to solve or fix
// to be solved in configuration
'node/no-unsupported-features/es-syntax': 'off',
'import/prefer-default-export': 'off',
'node/no-missing-import': 'off',
'@typescript-eslint/brace-style': 'off', // TODO: fix conflict with prettier/prettier in data-transfer/engine/index.ts
// to be cleaned up throughout codebase (too many to fix at the moment)
'@typescript-eslint/no-use-before-define': 'warn',
'@typescript-eslint/comma-dangle': 'off',
},
// Disable only for tests
overrides: [
{
files: ['**.test.ts'],
rules: {
'@typescript-eslint/ban-ts-comment': 'warn', // as long as javascript is allowed in our codebase, we want to test erroneous typescript usage
},
},
],
};