Skip to content

Commit e50d5a0

Browse files
chore: Replace tslint with eslint (#2555)
1 parent bc0608f commit e50d5a0

File tree

17 files changed

+14144
-5286
lines changed

17 files changed

+14144
-5286
lines changed

.eslintignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
dist
2+
node_modules
3+
packages/*/dist
4+
packages/*/node_modules
5+
test/runs
6+
test/input
7+
8+
license

.eslintrc.json

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
{
2+
"overrides": [
3+
{
4+
"extends": ["canonical/json"],
5+
"files": "*.json"
6+
},
7+
{
8+
"extends": [
9+
"eslint:recommended",
10+
"canonical/typescript",
11+
"canonical/typescript-type-checking",
12+
"plugin:import/errors",
13+
"plugin:import/warnings",
14+
"plugin:import/typescript"
15+
],
16+
"plugins": ["canonical"],
17+
"parserOptions": {
18+
"tsconfigRootDir": "./",
19+
"project": ["./tsconfig.json", "./packages/*/tsconfig.json"]
20+
},
21+
"settings": {
22+
"import/resolver": {
23+
"typescript": true,
24+
"node": true
25+
}
26+
},
27+
"rules": {
28+
"comma-dangle": "off",
29+
"no-extra-parens": "off",
30+
"no-case-declarations": "warn",
31+
"no-duplicate-imports": "error",
32+
"canonical/prefer-inline-type-import": "error",
33+
"typescript-sort-keys/string-enum": "off",
34+
35+
"sort-imports": [
36+
"error",
37+
{
38+
"ignoreDeclarationSort": true
39+
}
40+
],
41+
"import/first": "error",
42+
"import/order": [
43+
"error",
44+
{
45+
"newlines-between": "always",
46+
"groups": ["builtin", "external", "internal", "parent", "sibling", "index", "object", "type"],
47+
"pathGroups": [
48+
{
49+
"pattern": "@/**",
50+
"group": "internal",
51+
"position": "before"
52+
}
53+
],
54+
"alphabetize": {
55+
"order": "asc" /* sort in ascending order. Options: ['ignore', 'asc', 'desc'] */,
56+
"caseInsensitive": true /* ignore case. Options: [true, false] */
57+
}
58+
}
59+
],
60+
61+
"import/no-absolute-path": "error",
62+
"import/no-cycle": "error",
63+
"import/no-duplicates": "error",
64+
"import/no-extraneous-dependencies": "error",
65+
"import/no-named-as-default": "off",
66+
"import/no-useless-path-segments": "error",
67+
68+
"@typescript-eslint/class-literal-property-style": "off",
69+
"@typescript-eslint/comma-dangle": "off",
70+
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
71+
"@typescript-eslint/consistent-type-imports": ["error", { "prefer": "type-imports" }],
72+
"@typescript-eslint/explicit-function-return-type": "warn",
73+
"@typescript-eslint/indent": "off",
74+
"@typescript-eslint/quotes": ["error", "double", { "avoidEscape": true }],
75+
"@typescript-eslint/member-delimiter-style": "off",
76+
"@typescript-eslint/no-base-to-string": "warn",
77+
"@typescript-eslint/no-empty-interface": "warn",
78+
"@typescript-eslint/no-extra-parens": "off",
79+
"@typescript-eslint/no-loop-func": "warn",
80+
"@typescript-eslint/no-misused-promises": ["error", { "checksVoidReturn": false }],
81+
"@typescript-eslint/no-unused-vars": ["error", { "vars": "local", "args": "none" }],
82+
"@typescript-eslint/no-use-before-define": "warn",
83+
"@typescript-eslint/no-useless-empty-export": "error",
84+
"@typescript-eslint/prefer-readonly": "warn",
85+
"@typescript-eslint/prefer-reduce-type-parameter": "off",
86+
"@typescript-eslint/require-array-sort-compare": "off",
87+
"@typescript-eslint/space-before-function-paren": "off",
88+
"@typescript-eslint/switch-exhaustiveness-check": "error",
89+
"@typescript-eslint/unbound-method": "warn",
90+
"@typescript-eslint/unified-signatures": "error"
91+
},
92+
"overrides": [
93+
{
94+
"files": "*.d.ts",
95+
"rules": {
96+
"no-var": "off"
97+
}
98+
}
99+
],
100+
"files": "*.ts"
101+
}
102+
],
103+
"root": true
104+
}

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,3 @@ test/fixtures/objective-c/quicktype
3636
/.bsp
3737
.metals
3838
.scala-build
39-
.vscode

.vscode/launch.json

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
11
{
2-
// Use IntelliSense to learn about possible Node.js debug attributes.
3-
// Hover to view descriptions of existing attributes.
4-
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5-
"version": "0.2.0",
6-
"configurations": [
7-
{
8-
"name": "quicktype",
9-
"type": "node",
10-
"request": "launch",
11-
"program": "${workspaceRoot}/node_modules/ts-node/dist/_bin.js",
12-
"runtimeArgs": ["--nolazy"],
13-
"args": [
14-
"--project",
15-
"src/cli/tsconfig.json",
16-
"src/cli/index.ts",
17-
"--lang",
18-
"dart",
19-
"--src-lang",
20-
"json",
21-
"./test/inputs/json/priority/blns-object.json"
22-
],
23-
"cwd": "${workspaceRoot}",
24-
"protocol": "inspector"
25-
},
26-
{
27-
"name": "test",
28-
"type": "node",
29-
"request": "launch",
30-
"program": "${workspaceRoot}/node_modules/ts-node/dist/_bin.js",
31-
"args": ["--project", "test/tsconfig.json", "test/test.ts"],
32-
"cwd": "${workspaceRoot}",
33-
"protocol": "inspector",
34-
"env": {
35-
"CPUs": "1",
36-
"FIXTURE": "golang"
37-
}
38-
}
39-
]
2+
// Use IntelliSense to learn about possible Node.js debug attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "quicktype",
9+
"type": "node",
10+
"request": "launch",
11+
"program": "${workspaceRoot}/node_modules/ts-node/dist/_bin.js",
12+
"runtimeArgs": ["--nolazy"],
13+
"args": [
14+
"--project",
15+
"src/cli/tsconfig.json",
16+
"src/cli/index.ts",
17+
"--lang",
18+
"dart",
19+
"--src-lang",
20+
"json",
21+
"./test/inputs/json/priority/blns-object.json"
22+
],
23+
"cwd": "${workspaceRoot}",
24+
"protocol": "inspector"
25+
},
26+
{
27+
"name": "test",
28+
"type": "node",
29+
"request": "launch",
30+
"program": "${workspaceRoot}/node_modules/ts-node/dist/_bin.js",
31+
"args": ["--project", "test/tsconfig.json", "test/test.ts"],
32+
"cwd": "${workspaceRoot}",
33+
"protocol": "inspector",
34+
"env": {
35+
"CPUs": "1",
36+
"FIXTURE": "golang"
37+
}
38+
}
39+
]
4040
}

.vscode/settings.json

Lines changed: 38 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,39 @@
11
{
2-
// Place your settings in this file to overwrite default and user settings.
3-
"editor.formatOnSave": true,
4-
"spellright.ignoreFiles": [
5-
"**/.gitignore",
6-
"**/.spellignore"
7-
],
8-
"search.exclude": {
9-
"**/.git": true,
10-
"**/node_modules": true,
11-
"**/bower_components": true,
12-
"**/tmp": true,
13-
"output": true,
14-
"**/obj": true,
15-
"**/bin": true,
16-
"test/inputs": true,
17-
"test/runs": true,
18-
"app/build": true,
19-
"elm-stuff": true,
20-
"dist": true
21-
},
22-
"explorer.excludeGitIgnore": false,
23-
"spellright.documentTypes": [],
24-
"java.configuration.updateBuildConfiguration": "automatic"
25-
}
2+
// Place your settings in this file to overwrite default and user settings.
3+
"editor.formatOnSave": true,
4+
"search.exclude": {
5+
"**/.git": true,
6+
"**/node_modules": true,
7+
"**/bower_components": true,
8+
"**/tmp": true,
9+
"output": true,
10+
"**/obj": true,
11+
"**/bin": true,
12+
"test/inputs": true,
13+
"test/runs": true,
14+
"app/build": true,
15+
"elm-stuff": true,
16+
"dist": true
17+
},
18+
"explorer.excludeGitIgnore": false,
19+
"java.configuration.updateBuildConfiguration": "automatic",
20+
21+
"files.associations": {
22+
"*.schema": "jsonc"
23+
},
24+
25+
"[json]": {
26+
"editor.defaultFormatter": "esbenp.prettier-vscode",
27+
"editor.wordWrap": "on",
28+
"editor.insertSpaces": true,
29+
"editor.tabSize": 4,
30+
"editor.detectIndentation": false
31+
},
32+
"[jsonc]": {
33+
"editor.defaultFormatter": "esbenp.prettier-vscode",
34+
"editor.wordWrap": "on",
35+
"editor.insertSpaces": true,
36+
"editor.tabSize": 4,
37+
"editor.detectIndentation": false
38+
}
39+
}

.vscode/tasks.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)