Skip to content

Commit 64b61a7

Browse files
author
sanex3339
committed
Migration from tslint on eslint javascript-obfuscator#1
1 parent b575fb3 commit 64b61a7

File tree

112 files changed

+1256
-286
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+1256
-286
lines changed

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/test
2+
/webpack

.eslintrc.js

Lines changed: 260 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,260 @@
1+
module.exports = {
2+
"env": {
3+
"browser": true,
4+
"es6": true,
5+
"node": true
6+
},
7+
"parser": "@typescript-eslint/parser",
8+
"parserOptions": {
9+
"project": "src/tsconfig.node.json",
10+
"sourceType": "module"
11+
},
12+
"plugins": [
13+
"@typescript-eslint",
14+
"import",
15+
"jsdoc",
16+
"prefer-arrow",
17+
"unicorn"
18+
],
19+
"rules": {
20+
"@typescript-eslint/adjacent-overload-signatures": "error",
21+
"@typescript-eslint/array-type": "error",
22+
"@typescript-eslint/await-thenable": "error",
23+
"@typescript-eslint/ban-types": "error",
24+
"@typescript-eslint/class-name-casing": "error",
25+
"@typescript-eslint/consistent-type-assertions": "off",
26+
"@typescript-eslint/consistent-type-definitions": "error",
27+
"@typescript-eslint/explicit-member-accessibility": [
28+
"error",
29+
{
30+
"accessibility": "explicit"
31+
}
32+
],
33+
"@typescript-eslint/indent": [
34+
"off",
35+
4
36+
],
37+
"@typescript-eslint/interface-name-prefix": [
38+
"error",
39+
"always"
40+
],
41+
"@typescript-eslint/member-delimiter-style": [
42+
"error",
43+
{
44+
"multiline": {
45+
"delimiter": "semi",
46+
"requireLast": true
47+
},
48+
"singleline": {
49+
"delimiter": "semi",
50+
"requireLast": false
51+
}
52+
}
53+
],
54+
"@typescript-eslint/member-ordering": "off",
55+
"@typescript-eslint/no-empty-function": "off",
56+
"@typescript-eslint/no-empty-interface": "error",
57+
"@typescript-eslint/no-explicit-any": "off",
58+
"@typescript-eslint/no-floating-promises": "error",
59+
"@typescript-eslint/no-for-in-array": "error",
60+
"@typescript-eslint/no-inferrable-types": "off",
61+
"@typescript-eslint/no-misused-new": "error",
62+
"@typescript-eslint/no-namespace": "error",
63+
"@typescript-eslint/no-non-null-assertion": "error",
64+
"@typescript-eslint/no-param-reassign": "off",
65+
"@typescript-eslint/no-parameter-properties": "error",
66+
"@typescript-eslint/no-require-imports": "off",
67+
"@typescript-eslint/no-this-alias": "error",
68+
"@typescript-eslint/no-unnecessary-qualifier": "error",
69+
"@typescript-eslint/no-unnecessary-type-arguments": "error",
70+
"@typescript-eslint/no-unnecessary-type-assertion": "error",
71+
"@typescript-eslint/no-use-before-define": "off",
72+
"@typescript-eslint/no-var-requires": "error",
73+
"@typescript-eslint/prefer-for-of": "error",
74+
"@typescript-eslint/prefer-function-type": "error",
75+
"@typescript-eslint/prefer-namespace-keyword": "error",
76+
"@typescript-eslint/prefer-readonly": "error",
77+
"@typescript-eslint/promise-function-async": "error",
78+
"@typescript-eslint/quotes": "off",
79+
"@typescript-eslint/restrict-plus-operands": "error",
80+
"@typescript-eslint/semi": [
81+
"error",
82+
"always"
83+
],
84+
"@typescript-eslint/strict-boolean-expressions": "off",
85+
"@typescript-eslint/triple-slash-reference": "error",
86+
"@typescript-eslint/type-annotation-spacing": "error",
87+
"@typescript-eslint/unified-signatures": "error",
88+
"arrow-body-style": "off",
89+
"arrow-parens": [
90+
"off",
91+
"as-needed"
92+
],
93+
"camelcase": "off",
94+
"capitalized-comments": [
95+
"off"
96+
],
97+
"comma-dangle": "off",
98+
"complexity": [
99+
"error",
100+
{
101+
"max": 10
102+
}
103+
],
104+
"constructor-super": "error",
105+
"curly": "error",
106+
"default-case": "off",
107+
"dot-notation": "error",
108+
"eol-last": "error",
109+
"eqeqeq": [
110+
"error",
111+
"smart"
112+
],
113+
"guard-for-in": "error",
114+
"id-blacklist": "off",
115+
"id-match": "off",
116+
"import/no-default-export": "error",
117+
"import/no-deprecated": "off",
118+
"import/no-extraneous-dependencies": "off",
119+
"import/no-internal-modules": "error",
120+
"import/no-unassigned-import": "off",
121+
"import/order": [
122+
"off"
123+
],
124+
"jsdoc/no-types": "off",
125+
"linebreak-style": "error",
126+
"max-classes-per-file": [
127+
"error",
128+
1
129+
],
130+
"max-len": "off",
131+
"max-lines": [
132+
"error",
133+
500
134+
],
135+
"new-parens": "error",
136+
"newline-per-chained-call": "off",
137+
"no-bitwise": "off",
138+
"no-caller": "error",
139+
"no-cond-assign": "error",
140+
"no-console": [
141+
"error",
142+
{
143+
"allow": [
144+
"log",
145+
"warn",
146+
"dir",
147+
"timeLog",
148+
"assert",
149+
"clear",
150+
"count",
151+
"countReset",
152+
"group",
153+
"groupEnd",
154+
"table",
155+
"dirxml",
156+
"error",
157+
"groupCollapsed",
158+
"Console",
159+
"profile",
160+
"profileEnd",
161+
"timeStamp",
162+
"context"
163+
]
164+
}
165+
],
166+
"no-constant-condition": "error",
167+
"no-control-regex": "off",
168+
"no-debugger": "error",
169+
"no-duplicate-case": "error",
170+
"no-duplicate-imports": "error",
171+
"no-empty": "off",
172+
"no-eval": "off",
173+
"no-extra-bind": "error",
174+
"no-extra-semi": "error",
175+
"no-fallthrough": "off",
176+
"no-invalid-regexp": "error",
177+
"no-invalid-this": "off",
178+
"no-irregular-whitespace": "error",
179+
"no-magic-numbers": "off",
180+
"no-multi-str": "off",
181+
"no-multiple-empty-lines": "error",
182+
"no-new-wrappers": "error",
183+
"no-null/no-null": "off",
184+
"no-octal": "error",
185+
"no-octal-escape": "error",
186+
"no-redeclare": "error",
187+
"no-regex-spaces": "error",
188+
"no-restricted-syntax": [
189+
"error",
190+
"ForInStatement"
191+
],
192+
"no-return-await": "error",
193+
"no-sequences": "error",
194+
"no-shadow": [
195+
"error",
196+
{
197+
"hoist": "all"
198+
}
199+
],
200+
"no-sparse-arrays": "error",
201+
"no-template-curly-in-string": "error",
202+
"no-throw-literal": "error",
203+
"no-trailing-spaces": [
204+
"error",
205+
{
206+
"skipBlankLines": true
207+
}
208+
],
209+
"no-undef-init": "error",
210+
"no-underscore-dangle": "off",
211+
"no-unsafe-finally": "error",
212+
"no-unused-expressions": "off",
213+
"no-unused-labels": "error",
214+
"no-var": "error",
215+
"no-void": "error",
216+
"object-shorthand": "off",
217+
"one-var": [
218+
"error",
219+
"never"
220+
],
221+
"padding-line-between-statements": [
222+
"error",
223+
{
224+
"blankLine": "always",
225+
"prev": "*",
226+
"next": "return"
227+
}
228+
],
229+
"prefer-arrow/prefer-arrow-functions": "off",
230+
"prefer-const": "error",
231+
"prefer-object-spread": "off",
232+
"prefer-template": "error",
233+
"quote-props": [
234+
"error",
235+
"as-needed"
236+
],
237+
"radix": "error",
238+
"space-before-function-paren": "error",
239+
"spaced-comment": "error",
240+
"space-in-parens": [
241+
"error",
242+
"never"
243+
],
244+
"unicorn/catch-error-name": [
245+
"error",
246+
{
247+
"name": "error"
248+
}
249+
],
250+
"unicorn/no-array-instanceof": "error",
251+
"unicorn/no-nested-ternary": "error",
252+
"unicorn/no-unreadable-array-destructuring": "error",
253+
"unicorn/prefer-includes": "error",
254+
"unicorn/prefer-starts-ends-with": "error",
255+
"unicorn/prefer-trim-start-end": "error",
256+
"use-isnan": "error",
257+
"valid-typeof": "off",
258+
"yoda": "error"
259+
}
260+
};

dist/index.browser.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.cli.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
"estraverse": "4.3.0",
3535
"eventemitter3": "4.0.0",
3636
"fast-deep-equal": "3.1.1",
37-
"fork-ts-checker-webpack-plugin": "3.1.1",
3837
"inversify": "5.0.1",
3938
"js-string-escape": "1.0.1",
4039
"md5": "2.2.1",
@@ -61,8 +60,17 @@
6160
"@types/sinon": "7.5.1",
6261
"@types/string-template": "1.0.2",
6362
"@types/webpack-env": "1.15.0",
63+
"@typescript-eslint/eslint-plugin": "2.18.0",
64+
"@typescript-eslint/parser": "2.18.0",
6465
"chai": "4.2.0",
6566
"coveralls": "3.0.9",
67+
"eslint": "6.8.0",
68+
"eslint-plugin-import": "2.20.0",
69+
"eslint-plugin-jsdoc": "21.0.0",
70+
"eslint-plugin-no-null": "1.0.2",
71+
"eslint-plugin-prefer-arrow": "1.1.7",
72+
"eslint-plugin-unicorn": "15.0.1",
73+
"fork-ts-checker-webpack-plugin": "4.0.3",
6674
"mocha": "7.0.0",
6775
"nyc": "15.0.0",
6876
"pjson": "1.0.9",
@@ -72,10 +80,6 @@
7280
"threads": "1.0.0",
7381
"ts-loader": "6.2.1",
7482
"ts-node": "6.1.0",
75-
"tslint": "5.20.1",
76-
"tslint-eslint-rules": "5.4.0",
77-
"tslint-language-service": "0.9.9",
78-
"tslint-microsoft-contrib": "6.2.0",
7983
"typescript": "3.8.0-beta",
8084
"webpack": "4.41.5",
8185
"webpack-cli": "3.3.10",
@@ -102,7 +106,7 @@
102106
"test:mocha": "scripts/test-mocha",
103107
"test:removeTmpDir": "scripts/test-remove-tmp-dir",
104108
"test": "scripts/test",
105-
"tslint": "scripts/tslint",
109+
"eslint": "scripts/eslint",
106110
"travis": "scripts/travis",
107111
"git:addFiles": "scripts/git-add-files",
108112
"postinstall": "opencollective || exit 0"

scripts/build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
yarn run removeCacheDir &&
44
yarn run webpack:prod &&
5-
yarn run tslint &&
5+
yarn run eslint &&
66
yarn test

scripts/eslint

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
$(yarn bin)/eslint src/**/*.ts

scripts/travis

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
22

3-
yarn run tslint &&
3+
yarn run eslint &&
44
yarn test

scripts/tslint

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

0 commit comments

Comments
 (0)