-
Notifications
You must be signed in to change notification settings - Fork 12
/
typescript.js
49 lines (44 loc) · 1.29 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
const { addMissingRules, warn } = require("./utils");
// EcmaScript 6 specific configuration
module.exports = {
parserOptions: {
ecmaVersion: 2018,
sourceType: "module",
ecmaFeatures: {
jsx: true
},
// typescript-eslint specific options
warnOnUnsupportedTypeScriptVersion: true
},
settings: {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
// use <root>/tsconfig.json
typescript: {
alwaysTryTypes: true // always try to resolve types under `<roo/>@types` directory even it doesn't contain any source code, like `@types/unist`
}
}
},
rules: {
"@swissquote/swissquote/prettier/prettier": [
warn(),
{ parser: "typescript" }
],
// Has a TypeScript replacement
"no-array-constructor": "off",
"@swissquote/swissquote/@typescript-eslint/no-array-constructor": warn()
}
};
// Disable all the rules from ESLint that are handled by @typescript-eslint
addMissingRules(
require("@typescript-eslint/eslint-plugin").configs["eslint-recommended"]
.overrides[0].rules,
module.exports.rules
);
// Disable all the rules from @typescript-eslint that are handled by Prettier
addMissingRules(
require("eslint-config-prettier").rules,
module.exports.rules
);