|
17 | 17 | "react",
|
18 | 18 | "@typescript-eslint",
|
19 | 19 | "tailwindcss",
|
20 |
| - "react-hooks" |
| 20 | + "react-hooks", |
| 21 | + "simple-import-sort" |
21 | 22 | ],
|
22 | 23 | "rules": {
|
23 |
| - // "@next/next/no-img-element": "off", |
24 | 24 | "@typescript-eslint/no-explicit-any": "warn",
|
25 | 25 | "@typescript-eslint/explicit-module-boundary-types": "off",
|
26 | 26 | "@typescript-eslint/explicit-function-return-type": 0,
|
|
36 | 36 | "@typescript-eslint/no-empty-interface": "off",
|
37 | 37 | "@typescript-eslint/no-unused-vars": 0,
|
38 | 38 | "@typescript-eslint/no-use-before-define": 0,
|
| 39 | + |
39 | 40 | // Basic
|
40 | 41 | "array-callback-return": "warn",
|
41 | 42 | "no-console": "warn",
|
| 43 | + "no-multiple-empty-lines": ["error", { "max":1 }], |
42 | 44 | "no-prototype-builtins": 0,
|
43 |
| - // "no-expected-multiline": "warn", // can't find rule definition |
| 45 | + // "no-expected-multiline": "warn", // can"t find rule definition |
| 46 | + |
| 47 | + "padding-line-between-statements": [ |
| 48 | + "warn", |
| 49 | + { "blankLine": "always", "prev": "*", "next": "block" }, |
| 50 | + { "blankLine": "always", "prev": "block", "next": "*" }, |
| 51 | + { "blankLine": "always", "prev": "*", "next": "block-like" }, |
| 52 | + { "blankLine": "always", "prev": "block-like", "next": "*" } |
| 53 | + ], |
44 | 54 |
|
45 | 55 | // React
|
46 | 56 | "react/display-name": 0,
|
|
54 | 64 | }
|
55 | 65 | ],
|
56 | 66 | "react-hooks/rules-of-hooks": "off",
|
| 67 | + "simple-import-sort/imports": "error", |
| 68 | + "simple-import-sort/exports": "error", |
57 | 69 | "tailwindcss/enforces-negative-arbitrary-values": "off",
|
58 | 70 | "unused-imports/no-unused-imports": "error",
|
59 | 71 | "unused-imports/no-unused-vars": [
|
|
73 | 85 | "rules": {
|
74 | 86 | "react/prop-types": "off"
|
75 | 87 | }
|
| 88 | + }, |
| 89 | + { |
| 90 | + "files": ["*.js", "*.ts", "*.tsx"], |
| 91 | + "rules": { |
| 92 | + "simple-import-sort/imports": [ |
| 93 | + "error", |
| 94 | + { |
| 95 | + "groups": [ |
| 96 | + ["^(?:os|path|http|fs|crypto|util|events|stream|url|zlib|querystring|tls|dgram|net|dns|child_process|cluster|readline|vm|assert|buffer|process|timers)(\/.*)?$"], |
| 97 | + ["^(?!(@\/|\\.\\.\/|\\.\/))"], |
| 98 | + ["^@\/"], |
| 99 | + ["^(?:\\.\/|\\.\\.\/|\\.)"] |
| 100 | + ] |
| 101 | + } |
| 102 | + ] |
| 103 | + } |
76 | 104 | }
|
77 | 105 | ]
|
78 | 106 | }
|
0 commit comments