Skip to content

Commit db9abe0

Browse files
committed
Fix linting/syntax
1 parent b654779 commit db9abe0

File tree

3 files changed

+68
-10
lines changed

3 files changed

+68
-10
lines changed

.eslintrc.json

+58-4
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,70 @@
99
"@typescript-eslint"
1010
],
1111
"rules": {
12-
"@typescript-eslint/naming-convention": "warn",
12+
// Whitespace
13+
"indent": ["error", 2],
14+
"max-len": ["warn", { "code": 120 }],
15+
"array-bracket-newline": ["warn", "consistent"],
16+
"array-element-newline": ["warn", "consistent"],
17+
"function-paren-newline": ["warn", "consistent"],
18+
"object-curly-spacing": ["warn", "always", { "objectsInObjects": false }],
19+
"function-call-argument-newline": "off",
20+
"lines-between-class-members": "off",
21+
"padded-blocks": "off",
22+
"space-before-function-paren": ["warn", {"anonymous": "always", "named": "never", "asyncArrow": "always"}],
23+
24+
// Formatting
25+
"curly": "error",
26+
"arrow-parens": ["warn", "as-needed"],
27+
"dot-location": ["warn", "property"],
28+
"quote-props": "off",
29+
"quotes": ["warn", "single"],
30+
"semi": "warn",
1331
"@typescript-eslint/semi": "warn",
14-
"curly": "warn",
32+
33+
// Style and pitfalls
34+
"class-methods-use-this": "off",
1535
"eqeqeq": "warn",
36+
"func-style": ["warn", "declaration"],
37+
"multiline-ternary": "off",
38+
"no-console": "off",
39+
"no-else-return": "off",
40+
"no-invalid-this": "off",
41+
"no-magic-numbers": ["warn", { "ignore": [0, 1] }],
42+
"no-negated-condition": "off",
43+
"no-promise-executor-return": "off",
44+
"no-ternary": "off",
1645
"no-throw-literal": "warn",
17-
"semi": "off"
46+
"no-undef-init": "off",
47+
"no-undefined": "off",
48+
"no-underscore-dangle": "off",
49+
"no-unused-vars": ["warn", { "args": "none" }],
50+
"no-use-before-define": "off",
51+
"one-var": "off",
52+
"prefer-destructuring": "off",
53+
"prefer-template": "off",
54+
"sort-keys": "off",
55+
"@typescript-eslint/naming-convention": "warn",
56+
57+
// Stay out of my comments
58+
"capitalized-comments": "off",
59+
"line-comment-position": "off",
60+
"lines-around-comment": "off",
61+
"multiline-comment-style": "off",
62+
"no-inline-comments": "off",
63+
"no-warning-comments": "off",
64+
65+
// No limits
66+
"max-classes-per-file": "off",
67+
"max-lines-per-function": "off",
68+
"max-lines": "off",
69+
"max-params": "off",
70+
"max-statements": "off"
1871
},
1972
"ignorePatterns": [
2073
"out",
2174
"dist",
2275
"**/*.d.ts"
76+
// "webpack.config.js"
2377
]
24-
}
78+
}

tsconfig.json

+7-5
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77
],
88
"sourceMap": true,
99
"rootDir": "src",
10-
"strict": true /* enable all strict type-checking options */
11-
/* Additional Checks */
12-
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
13-
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
14-
// "noUnusedParameters": true, /* Report errors on unused parameters. */
10+
"strict": true,
11+
"noUnusedLocals": true,
12+
"noImplicitReturns": true,
13+
"noFallthroughCasesInSwitch": true,
14+
"noUncheckedIndexedAccess": true,
15+
"esModuleInterop": true,
16+
"forceConsistentCasingInFileNames": true
1517
},
1618
"exclude": [
1719
"node_modules",

webpack.config.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
//@ts-check
2+
/* eslint-disable max-len */
3+
24

35
'use strict';
46

@@ -10,7 +12,7 @@ const path = require('path');
1012
/** @type WebpackConfig */
1113
const extensionConfig = {
1214
target: 'node', // vscode extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/
13-
mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
15+
mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
1416

1517
entry: './src/extension.ts', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/
1618
output: {

0 commit comments

Comments
 (0)