Skip to content

Commit e59783e

Browse files
committed
chore: eslint
# Conflicts: # .eslintrc.js # package.json
1 parent 7608ebb commit e59783e

File tree

4 files changed

+45
-30
lines changed

4 files changed

+45
-30
lines changed

.eslintrc.js

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
module.exports = {
2-
env: {
3-
browser: true
4-
},
2+
extends: ['plugin:prettier/recommended'],
3+
plugins: ['prettier', '@typescript-eslint'],
54
parser: '@typescript-eslint/parser',
65
parserOptions: {
7-
createDefaultProgram: true,
8-
project: 'tsconfig.json',
9-
sourceType: 'module'
6+
ecmaVersion: 2018,
7+
sourceType: 'module',
8+
parser: '@typescript-eslint/parser',
9+
project: 'tsconfig.eslint.json',
10+
warnOnUnsupportedTypeScriptVersion: false,
11+
tsconfigRootDir: __dirname,
1012
},
11-
plugins: ['@typescript-eslint'],
1213
rules: {
14+
'prettier/prettier': 'warn',
1315
'@typescript-eslint/adjacent-overload-signatures': 'error',
1416
'@typescript-eslint/array-type': 'error',
1517
'@typescript-eslint/await-thenable': 'error',
@@ -20,21 +22,21 @@ module.exports = {
2022
'@typescript-eslint/explicit-member-accessibility': [
2123
'off',
2224
{
23-
accessibility: 'explicit'
24-
}
25+
accessibility: 'explicit',
26+
},
2527
],
2628
'@typescript-eslint/indent': [
2729
'error',
2830
4,
2931
{
3032
FunctionDeclaration: {
31-
parameters: 'first'
33+
parameters: 'first',
3234
},
3335
FunctionExpression: {
34-
parameters: 'first'
36+
parameters: 'first',
3537
},
36-
SwitchCase:1
37-
}
38+
SwitchCase: 1,
39+
},
3840
],
3941
'@typescript-eslint/interface-name-prefix': 'off',
4042
'@typescript-eslint/member-delimiter-style': 'error',
@@ -59,8 +61,8 @@ module.exports = {
5961
'error',
6062
'single',
6163
{
62-
avoidEscape: true
63-
}
64+
avoidEscape: true,
65+
},
6466
],
6567
'@typescript-eslint/semi': ['error'],
6668
'@typescript-eslint/space-within-parens': ['off', 'never'],
@@ -86,17 +88,17 @@ module.exports = {
8688
ignoreCase: false,
8789
ignoreDeclarationSort: true,
8890
ignoreMemberSort: false,
89-
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single']
90-
}
91+
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
92+
},
9193
],
9294
'linebreak-style': 'off',
9395
'max-classes-per-file': 'off',
9496
'max-len': [
9597
'off',
9698
{
9799
ignorePattern: '^import |^export {(.*?)}',
98-
code: 200
99-
}
100+
code: 200,
101+
},
100102
],
101103
'new-parens': 'off',
102104
'newline-per-chained-call': 'off',
@@ -126,9 +128,9 @@ module.exports = {
126128
'profile',
127129
'profileEnd',
128130
'timeStamp',
129-
'context'
130-
]
131-
}
131+
'context',
132+
],
133+
},
132134
],
133135
'no-constant-condition': 'error',
134136
'no-control-regex': 'off',
@@ -143,14 +145,14 @@ module.exports = {
143145
'no-irregular-whitespace': 'off',
144146
'no-multiple-empty-lines': 'off',
145147
'no-new-wrappers': 'error',
146-
'no-redeclare': 'error',
148+
'no-redeclare': ['error', { builtinGlobals: false }],
147149
'no-regex-spaces': 'error',
148150
'no-return-await': 'error',
149151
'no-shadow': [
150152
'off',
151153
{
152-
hoist: 'all'
153-
}
154+
hoist: 'all',
155+
},
154156
],
155157
'no-throw-literal': 'error',
156158
'no-trailing-spaces': 'error',
@@ -161,8 +163,8 @@ module.exports = {
161163
'error',
162164
{
163165
allowTaggedTemplates: true,
164-
allowShortCircuit: true
165-
}
166+
allowShortCircuit: true,
167+
},
166168
],
167169
'no-unused-labels': 'error',
168170
'no-var': 'error',
@@ -174,6 +176,6 @@ module.exports = {
174176
radix: 'error',
175177
'space-before-function-paren': 'off',
176178
'use-isnan': 'error',
177-
'valid-typeof': 'off'
178-
}
179+
'valid-typeof': 'off',
180+
},
179181
};

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"plugin.watch.android": "npm i && npm-watch build.android",
2020
"plugin.watch.ios": "npm i && npm-watch build.ios",
2121
"plugin.watch": "npm run plugin.watch.tsc & npm run plugin.watch.android & npm run plugin.watch.ios",
22-
"publish": "npm run setup && npm run build && lerna publish --create-release=github",
22+
"publish": "npm run setup && npm run build && lerna publish --create-release=github --force-publish",
2323
"doc": "typedoc --out docs --tsconfig tsconfig.doc.json --includeDeclarations --excludeExternals --mode file --ignoreCompilerErrors --excludeNotExported --excludePrivate --theme minimal",
2424
"commitmsg": "commitlint -e $GIT_PARAMS"
2525
},
@@ -52,9 +52,12 @@
5252
"@typescript-eslint/parser": "4.0.1",
5353
"cpy-cli": "^3.1.1",
5454
"eslint": "7.8.1",
55+
"eslint-config-prettier": "^6.15.0",
56+
"eslint-plugin-prettier": "^3.3.1",
5557
"husky": "^4.3.0",
5658
"lerna": "^3.22.1",
5759
"npm-watch": "^0.7.0",
60+
"prettier": "^2.2.1",
5861
"prompt": "^1.0.0",
5962
"rimraf": "^3.0.2",
6063
"ts-patch": "1.3.0",

src/tsconfig.eslint.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
3+
"extends": "./tsconfig.json",
4+
"include": ["**/*", ".eslintrc.js", "app.webpack.config.js"]
5+
}

tsconfig.eslint.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
3+
"extends": "./tsconfig.json",
4+
"include": ["**/*", ".eslintrc.js", "app.webpack.config.js"]
5+
}

0 commit comments

Comments
 (0)