Skip to content

Commit 1645bba

Browse files
authored
Configure eslint for project (#4)
* Configured eslint * Fixed eslint errors
1 parent deb8ab4 commit 1645bba

8 files changed

+700
-8
lines changed

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist
2+
node_modules
3+
*.config.js

.eslintrc

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"parserOptions": {
5+
"ecmaVersion": 2020,
6+
"sourceType": "module"
7+
},
8+
"plugins": ["@typescript-eslint", "simple-import-sort"],
9+
"extends": [
10+
"prettier/@typescript-eslint",
11+
"plugin:prettier/recommended",
12+
"eslint:recommended",
13+
"plugin:@typescript-eslint/eslint-recommended",
14+
"plugin:@typescript-eslint/recommended"
15+
],
16+
"rules": {
17+
"@typescript-eslint/no-namespace": "off",
18+
"@typescript-eslint/explicit-module-boundary-types": "off",
19+
"@typescript-eslint/explicit-function-return-type": "off",
20+
"@typescript-eslint/no-empty-interface": "off",
21+
"@typescript-eslint/no-non-null-assertion": "off",
22+
"@typescript-eslint/ban-types": "off",
23+
"no-console": "off",
24+
"simple-import-sort/imports": [
25+
"warn",
26+
{
27+
"groups": [
28+
// Node.js builtins.
29+
[
30+
"^(assert|buffer|child_process|cluster|console|constants|crypto|dgram|dns|domain|events|fs|http|https|module|net|os|path|punycode|querystring|readline|repl|stream|string_decoder|sys|timers|tls|tty|typescript|url|util|vm|zlib|freelist|v8|process|async_hooks|http2|perf_hooks)(/.*|$)"
31+
],
32+
// Packages.
33+
["markdown-table", "^@?\\w"],
34+
// Side effect imports.
35+
["^\\u0000"],
36+
// Parent imports.
37+
[
38+
"^src",
39+
"^\\./(?=.*/)(?!/?$)",
40+
"^\\.(?!/?$)",
41+
"^\\./?$",
42+
"^\\.\\.(?!/?$)",
43+
"^\\.\\./?$"
44+
]
45+
]
46+
}
47+
]
48+
}
49+
}

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"editor.codeActionsOnSave": {
3+
"source.fixAll": true
4+
}
5+
}

0 commit comments

Comments
 (0)