-
Notifications
You must be signed in to change notification settings - Fork 21
/
.eslintrc.js
57 lines (52 loc) · 2.13 KB
/
.eslintrc.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
50
51
52
53
54
55
56
57
module.exports = {
extends: ["airbnb-typescript-prettier"], // if you're using typescript,
parserOptions: {
project: "./tsconfig.json",
sourceType: "module",
},
ignorePatterns: ['.eslintrc.js'], // !!! new and important part !!!
rules: {
// I prefer to use named export
// See: https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-named-as-default.md#importno-named-as-default
"import/prefer-default-export": 0,
// Ignore test files per the docs
// See: https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md#options
"import/no-extraneous-dependencies": [
"error", {"devDependencies": ["**/*.test.+(ts|tsx|js|jsx)", "**/*.spec.+(ts|tsx|js|jsx)"]}],
"import/no-named-as-default": 0,
// See: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-non-null-assertion.md
"@typescript-eslint/no-non-null-assertion": 0,
// See: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/explicit-function-return-type.md
"@typescript-eslint/explicit-function-return-type": 0,
// See: https://eslint.org/docs/rules/no-unused-expressions
"no-unused-expressions": ["error", { "allowShortCircuit": true }],
// First import is the React package, just to follow the standard convention.
// See: https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md
"import/order": [
"error",
{
groups: ["builtin", "external", "internal"],
pathGroups: [
{
pattern: "react",
group: "external",
position: "before",
},
{
pattern: "*.+(css|sass|less|scss|pcss|styl)",
group: "index",
patternOptions: { matchBase: true },
position: "after",
},
],
pathGroupsExcludedImportTypes: ["react"],
"newlines-between": "always",
alphabetize: {
order: "asc",
caseInsensitive: true,
},
},
],
},
// plugins: ['prettier'],
};