Skip to content

Commit f703897

Browse files
committed
fix: add linting step to ci and eslint config and missing editorconfig
1 parent 0a75884 commit f703897

20 files changed

+875
-32
lines changed

.editorconfig

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 4
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
quote_type = single
11+
12+
[package.json]
13+
indent_size = 2
14+
15+
[*.yml]
16+
indent_size = 2

.eslintignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
dist
3+
test
4+
docs

.eslintrc.cjs

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module.exports = {
2+
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
3+
parser: '@typescript-eslint/parser',
4+
plugins: ['@typescript-eslint'],
5+
root: true,
6+
rules: {
7+
"@typescript-eslint/consistent-type-imports": ["warn", {
8+
prefer: "type-imports",
9+
fixStyle: "separate-type-imports",
10+
}],
11+
// TODO: enable me
12+
"@typescript-eslint/no-explicit-any": "off",
13+
"@typescript-eslint/ban-types": "off",
14+
"@typescript-eslint/no-non-null-assertion": "off",
15+
"prefer-rest-params": "off",
16+
"@typescript-eslint/no-this-alias": "off",
17+
"@typescript-eslint/no-unused-vars": ["error", {
18+
"argsIgnorePattern": "^_", // allow unused args starting with _
19+
}],
20+
}
21+
};

.github/workflows/node.js.yml

+1
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ jobs:
2828
cache: 'npm'
2929
- run: npm ci
3030
- run: npm run build --if-present
31+
- run: npm run lint
3132
- run: npm test

.gitignore

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
dist
22
.DS_Store
3-
node_modules
3+
node_modules
4+
5+
6+
# Editor directories and files
7+
.vscode
8+
.idea
9+
*.iml

.npmignore

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
/docs
22
/test
3-
/.github
3+
/.github
4+
/.gitignore
5+
/.editorconfig
6+
/.eslintrc.cjs
7+
/.eslintignore

0 commit comments

Comments
 (0)