Skip to content

Commit 3c32d0a

Browse files
committed
Generate near-equivalent .eslintrc.js
1 parent 13930d2 commit 3c32d0a

File tree

2 files changed

+193
-0
lines changed

2 files changed

+193
-0
lines changed

.eslintrc.js

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
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+
module.exports = {
15+
"env": {
16+
"browser": true,
17+
"es6": true,
18+
"node": true
19+
},
20+
"extends": [
21+
"plugin:@typescript-eslint/recommended",
22+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
23+
"prettier",
24+
"prettier/@typescript-eslint"
25+
],
26+
"parser": "@typescript-eslint/parser",
27+
"parserOptions": {
28+
"project": "tsconfig.json",
29+
"sourceType": "module"
30+
},
31+
"plugins": [
32+
"eslint-plugin-jsdoc",
33+
"eslint-plugin-prefer-arrow",
34+
"@typescript-eslint",
35+
"@typescript-eslint/tslint"
36+
],
37+
"rules": {
38+
"@typescript-eslint/adjacent-overload-signatures": "error",
39+
"@typescript-eslint/array-type": [
40+
"error",
41+
{
42+
"default": "array"
43+
}
44+
],
45+
"@typescript-eslint/ban-types": [
46+
"error",
47+
{
48+
"types": {
49+
"Object": {
50+
"message": "Avoid using the `Object` type. Did you mean `object`?"
51+
},
52+
"Function": {
53+
"message": "Avoid using the `Function` type. Prefer a specific function type, like `() => void`."
54+
},
55+
"Boolean": {
56+
"message": "Avoid using the `Boolean` type. Did you mean `boolean`?"
57+
},
58+
"Number": {
59+
"message": "Avoid using the `Number` type. Did you mean `number`?"
60+
},
61+
"String": {
62+
"message": "Avoid using the `String` type. Did you mean `string`?"
63+
},
64+
"Symbol": {
65+
"message": "Avoid using the `Symbol` type. Did you mean `symbol`?"
66+
}
67+
}
68+
}
69+
],
70+
"@typescript-eslint/consistent-type-assertions": "error",
71+
"@typescript-eslint/dot-notation": "error",
72+
"@typescript-eslint/indent": "error",
73+
"@typescript-eslint/naming-convention": "error",
74+
"@typescript-eslint/no-empty-function": "error",
75+
"@typescript-eslint/no-empty-interface": "error",
76+
"@typescript-eslint/no-explicit-any": "off",
77+
"@typescript-eslint/no-misused-new": "error",
78+
"@typescript-eslint/no-namespace": "error",
79+
"@typescript-eslint/no-parameter-properties": "off",
80+
"@typescript-eslint/no-shadow": [
81+
"error",
82+
{
83+
"hoist": "all"
84+
}
85+
],
86+
"@typescript-eslint/no-unused-expressions": "error",
87+
"@typescript-eslint/no-use-before-define": "off",
88+
"@typescript-eslint/no-var-requires": "error",
89+
"@typescript-eslint/prefer-for-of": "error",
90+
"@typescript-eslint/prefer-function-type": "error",
91+
"@typescript-eslint/prefer-namespace-keyword": "error",
92+
"@typescript-eslint/triple-slash-reference": [
93+
"error",
94+
{
95+
"path": "always",
96+
"types": "prefer-import",
97+
"lib": "always"
98+
}
99+
],
100+
"@typescript-eslint/unified-signatures": "error",
101+
"complexity": "off",
102+
"constructor-super": "error",
103+
"eqeqeq": [
104+
"error",
105+
"smart"
106+
],
107+
"guard-for-in": "error",
108+
"id-blacklist": [
109+
"error",
110+
"any",
111+
"Number",
112+
"number",
113+
"String",
114+
"string",
115+
"Boolean",
116+
"boolean",
117+
"Undefined",
118+
"undefined"
119+
],
120+
"id-match": "error",
121+
"jsdoc/check-alignment": "error",
122+
"jsdoc/check-indentation": "error",
123+
"jsdoc/newline-after-description": "error",
124+
"max-classes-per-file": "off",
125+
"new-parens": "error",
126+
"no-bitwise": "error",
127+
"no-caller": "error",
128+
"no-cond-assign": "error",
129+
"no-console": "error",
130+
"no-debugger": "error",
131+
"no-empty": "error",
132+
"no-eval": "error",
133+
"no-fallthrough": "off",
134+
"no-invalid-this": "off",
135+
"no-new-wrappers": "error",
136+
"no-throw-literal": "error",
137+
"no-trailing-spaces": "error",
138+
"no-undef-init": "error",
139+
"no-underscore-dangle": "error",
140+
"no-unsafe-finally": "error",
141+
"no-unused-labels": "error",
142+
"no-var": "error",
143+
"object-shorthand": "error",
144+
"one-var": [
145+
"error",
146+
"never"
147+
],
148+
"prefer-arrow/prefer-arrow-functions": "error",
149+
"prefer-const": "error",
150+
"radix": "error",
151+
"spaced-comment": [
152+
"error",
153+
"always",
154+
{
155+
"markers": [
156+
"/"
157+
]
158+
}
159+
],
160+
"use-isnan": "error",
161+
"valid-typeof": "off",
162+
"@typescript-eslint/tslint/config": [
163+
"error",
164+
{
165+
"rules": {
166+
"file-header": [
167+
true,
168+
{
169+
"allow-single-line-comments": true,
170+
"match": "Copyright \\(c\\) Microsoft Corporation."
171+
}
172+
]
173+
}
174+
}
175+
]
176+
}
177+
};

tslint-to-eslint-config.log

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
5 ESLint rules behave differently from their TSLint counterparts:
2+
* no-invalid-this:
3+
- Functions in methods will no longer be ignored.
4+
* @typescript-eslint/no-unused-expressions:
5+
- The TSLint optional config "allow-new" is the default ESLint behavior and will no longer be ignored.
6+
* prefer-arrow/prefer-arrow-functions:
7+
- ESLint does not support allowing standalone function declarations.
8+
- ESLint does not support allowing named functions defined with the function keyword.
9+
* eqeqeq:
10+
- Option "smart" allows for comparing two literal values, evaluating the value of typeof and null comparisons.
11+
* no-underscore-dangle:
12+
- Leading and trailing underscores (_) on identifiers will now be ignored.
13+
14+
1 rule is not known by tslint-to-eslint-config to have an ESLint equivalent:
15+
* tslint-to-eslint-config does not know the ESLint equivalent for TSLint's "file-header".
16+

0 commit comments

Comments
 (0)