forked from ionic-team/capacitor
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
44 lines (41 loc) · 1.55 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'import'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'plugin:import/typescript',
],
rules: {
// https://eslint.org/docs/rules/
'no-fallthrough': 'off', // https://github.com/ionic-team/eslint-config/issues/7
'no-constant-condition': 'off',
// https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin/docs/rules
'@typescript-eslint/no-this-alias': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-module-boundary-types': [
'error',
{ allowArgumentsExplicitlyTypedAsAny: true },
],
// https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin/docs/rules
'@typescript-eslint/array-type': 'error',
'@typescript-eslint/consistent-type-assertions': 'error',
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/prefer-optional-chain': 'error',
// https://github.com/benmosher/eslint-plugin-import
'import/first': 'error',
'import/order': [
'error',
{
'alphabetize': { order: 'asc', caseInsensitive: false },
'groups': [['builtin', 'external'], 'parent', ['sibling', 'index']],
'newlines-between': 'always',
},
],
'import/newline-after-import': 'error',
'import/no-duplicates': 'error',
'import/no-mutable-exports': 'error',
},
};