Skip to content

Commit 46a4dc3

Browse files
committed
Updates linting and formatting rules
1 parent 099ba08 commit 46a4dc3

File tree

9 files changed

+1432
-82
lines changed

9 files changed

+1432
-82
lines changed

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.js
2+
test/**/index.ts
3+
test/**/runTest.ts

.eslintrc.js

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
11
/**@type {import('eslint').Linter.Config} */
22
// eslint-disable-next-line no-undef
33
module.exports = {
4-
root: true,
5-
parser: '@typescript-eslint/parser',
6-
plugins: [
7-
'@typescript-eslint',
8-
],
9-
extends: [
10-
'eslint:recommended',
11-
'plugin:@typescript-eslint/recommended',
12-
],
13-
rules: {
14-
'semi': [2, "always"],
15-
'@typescript-eslint/no-unused-vars': 0,
16-
'@typescript-eslint/no-explicit-any': 0,
17-
'@typescript-eslint/explicit-module-boundary-types': 0,
18-
'@typescript-eslint/no-non-null-assertion': 0,
19-
}
20-
};
4+
root: true,
5+
parser: '@typescript-eslint/parser',
6+
plugins: ['@typescript-eslint', 'eslint-plugin-jsdoc', 'eslint-plugin-import', 'prettier'],
7+
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
8+
rules: {
9+
'semi': [2, 'always'],
10+
'@typescript-eslint/no-unused-vars': 0,
11+
'@typescript-eslint/no-explicit-any': 0,
12+
'@typescript-eslint/explicit-module-boundary-types': 0,
13+
'@typescript-eslint/no-non-null-assertion': 0,
14+
},
15+
};

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# .prettierignore
2+
3+
node_modules
4+
dist
5+
out

.prettierrc.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
module.exports = {
2-
trailingComma: 'es5',
2+
printWidth: 100,
33
tabWidth: 2,
4-
semi: false,
4+
useTabs: false,
5+
semi: true,
56
singleQuote: true,
7+
jsxSingleQuote: false,
8+
quoteProps: 'consistent',
9+
trailingComma: 'es5',
10+
bracketSpacing: true,
11+
jsxBracketSameLine: false,
12+
arrowParens: 'avoid',
13+
endOfLine: 'lf',
14+
embeddedLanguageFormatting: 'auto',
615
};

.vscode/extensions.json

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
{
2-
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
3-
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
4-
// List of extensions which should be recommended for users of this workspace.
5-
"recommendations": [
6-
"dbaeumer.vscode-eslint"
7-
],
8-
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
9-
"unwantedRecommendations": []
10-
}
2+
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
3+
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
4+
// List of extensions which should be recommended for users of this workspace.
5+
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"],
6+
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
7+
"unwantedRecommendations": []
8+
}

.vscode/settings.json

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,32 @@
11
// Place your settings in this file to overwrite default and user settings.
22
{
3-
"files.exclude": {
4-
"out": false // set this to true to hide the "out" folder with the compiled JS files
5-
},
6-
"search.exclude": {
7-
"out": true // set this to false to include "out" folder in search results
8-
}
9-
}
3+
"files.exclude": {
4+
"out": false // set this to true to hide the "out" folder with the compiled JS files
5+
},
6+
"search.exclude": {
7+
"out": true // set this to false to include "out" folder in search results
8+
},
9+
"[typescript]": {
10+
"editor.defaultFormatter": "esbenp.prettier-vscode",
11+
"editor.formatOnSave": true
12+
},
13+
"[javascript]": {
14+
"editor.defaultFormatter": "esbenp.prettier-vscode",
15+
"editor.formatOnSave": true
16+
},
17+
"[json]": {
18+
"editor.defaultFormatter": "esbenp.prettier-vscode",
19+
"editor.formatOnSave": true
20+
},
21+
"[jsonc]": {
22+
"editor.defaultFormatter": "esbenp.prettier-vscode",
23+
"editor.formatOnSave": true
24+
},
25+
"[yaml]": {
26+
"editor.defaultFormatter": "esbenp.prettier-vscode",
27+
"editor.formatOnSave": true
28+
},
29+
"[markdown]": {
30+
"editor.defaultFormatter": "esbenp.prettier-vscode"
31+
}
32+
}

0 commit comments

Comments
 (0)