Skip to content

Commit 8e6c8b7

Browse files
authored
Merge pull request #662 from jpogran/gh-642-eslint-migration
(GH-642) Migrate to ES Lint
2 parents 86ec727 + 2f15f1f commit 8e6c8b7

32 files changed

+1443
-341
lines changed

.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
assets
2+
node_modules
3+
out
4+
src/test
5+
vendor

.eslintrc.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
👋 Hi! This file was autogenerated by tslint-to-eslint-config.
3+
https://github.com/typescript-eslint/tslint-to-eslint-config
4+
5+
It represents the closest reasonable ESLint configuration to this
6+
project's original TSLint configuration.
7+
8+
We recommend eventually switching this configuration to extend from
9+
the recommended rulesets in typescript-eslint.
10+
https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md
11+
12+
Happy linting! 💖
13+
*/
14+
{
15+
"env": { "browser": true, "es6": true, "node": true },
16+
"parser": "@typescript-eslint/parser",
17+
"parserOptions": { "sourceType": "module" },
18+
"plugins": ["@typescript-eslint", "prettier"],
19+
"extends": [
20+
"eslint:recommended",
21+
"plugin:@typescript-eslint/eslint-recommended",
22+
"plugin:@typescript-eslint/recommended",
23+
"plugin:prettier/recommended",
24+
"prettier"
25+
],
26+
"rules": {
27+
"no-return-await": "error",
28+
"block-scoped-var": "error",
29+
"default-case": "error",
30+
"default-case-last": "error",
31+
"default-param-last": "error",
32+
"guard-for-in": "error",
33+
"no-extend-native": "error",
34+
"no-invalid-this": "error",
35+
"no-useless-call": "error",
36+
"no-void": "error",
37+
"wrap-iife": "error",
38+
"no-console": "error",
39+
"no-await-in-loop": "error",
40+
"no-template-curly-in-string": "error",
41+
"require-atomic-updates": "error",
42+
"no-useless-backreference": "error",
43+
"@typescript-eslint/class-name-casing": "warn",
44+
"@typescript-eslint/member-delimiter-style": [
45+
"warn",
46+
{
47+
"multiline": { "delimiter": "semi", "requireLast": true },
48+
"singleline": { "delimiter": "semi", "requireLast": false }
49+
}
50+
],
51+
"@typescript-eslint/no-unused-expressions": "warn",
52+
"@typescript-eslint/semi": ["warn", "always"],
53+
"@typescript-eslint/interface-name-prefix": "off",
54+
"curly": "warn",
55+
"eqeqeq": ["warn", "always"],
56+
"no-redeclare": "warn",
57+
"no-throw-literal": "warn"
58+
}
59+
}

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"recommendations": [
3+
"dbaeumer.vscode-eslint",
34
"eamodio.gitlens",
45
"esbenp.prettier-vscode",
5-
"ms-vscode.vscode-typescript-tslint-plugin",
66
"wwm.better-align",
77
"rebornix.Ruby"
88
]

.vscode/settings.json

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,55 @@
1-
// Place your settings in this file to overwrite default and user settings.
21
{
2+
"editor.formatOnSave": true,
3+
"editor.formatOnType": true,
34
"editor.insertSpaces": true,
45
"editor.tabSize": 2,
56
"editor.trimAutoWhitespace": true,
6-
77
"files.encoding": "utf8",
8-
// The default end of line character. Use \n for LF and \r\n for CRLF.
98
"files.eol": "\n",
109
"files.insertFinalNewline": true,
1110
"files.trimFinalNewlines": true,
12-
"files.trimTrailingWhitespace": false,
11+
"files.trimTrailingWhitespace": true,
1312
"files.exclude": {
1413
"node_modules": true,
15-
"out": true, // set this to true to hide the "out" folder with the compiled JS files
16-
".vscode-test": true
14+
"out": true
1715
},
1816
"search.exclude": {
1917
"node_modules": true,
20-
"out": true // set this to false to include "out" folder in search results
18+
"out": true
19+
},
20+
"[javascript]": {
21+
"editor.defaultFormatter": "esbenp.prettier-vscode"
22+
},
23+
"[json]": {
24+
"editor.defaultFormatter": "esbenp.prettier-vscode",
25+
"editor.quickSuggestions": {
26+
"strings": true
27+
},
28+
"editor.suggest.insertMode": "replace"
29+
},
30+
"[jsonc]": {
31+
"editor.defaultFormatter": "esbenp.prettier-vscode",
32+
"editor.quickSuggestions": {
33+
"strings": true
34+
},
35+
"editor.suggest.insertMode": "replace"
2136
},
22-
23-
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
2437
"typescript.tsc.autoDetect": "off",
2538
"typescript.format.enable": false,
2639
"[typescript]": {
27-
"editor.formatOnSave": true,
28-
"editor.formatOnType": true,
40+
"editor.codeActionsOnSave": {
41+
"source.fixAll": true,
42+
"source.organizeImports": true
43+
},
2944
"editor.defaultFormatter": "esbenp.prettier-vscode"
45+
},
46+
"eslint.enable": true,
47+
"eslint.lintTask.enable": true,
48+
"eslint.alwaysShowStatus": true,
49+
"eslint.codeActionsOnSave.mode": "all",
50+
"eslint.run": "onType",
51+
"puppet.trace.server": {
52+
"verbosity": "verbose",
53+
"format": "json"
3054
}
3155
}

0 commit comments

Comments
 (0)