UNPKG

4.32 kBJavaScriptView Raw
1module.exports = {
2 env: {
3 browser: true,
4 es6: true,
5 },
6 extends: [
7 'airbnb-base',
8 'plugin:unicorn/recommended',
9 'plugin:@internal/eslint-plugin/recommended',
10 ],
11 parserOptions: {
12 ecmaVersion: '2020',
13 sourceType: 'module',
14 },
15 ignorePatterns: [
16 '!.*',
17 '/dist',
18 '/examples/assets/library',
19 '/test/coverage',
20 '/test/helpers',
21 ],
22 rules: {
23 'class-methods-use-this': 'off',
24 'comma-dangle': ['error', {
25 arrays: 'always-multiline',
26 exports: 'always-multiline',
27 functions: 'never',
28 imports: 'always-multiline',
29 objects: 'always-multiline',
30 }],
31 'consistent-return': 'off',
32 curly: ['error', 'all'],
33 'default-case': 'off',
34 'func-names': 'off',
35 'import/no-unresolved': 'off',
36 'import/prefer-default-export': 'off',
37 indent: ['error', 4, {
38 SwitchCase: 1,
39 }],
40 'linebreak-style': ['error', 'unix'],
41 'max-len': 'off',
42 'no-console': 'off',
43 'no-continue': 'off',
44 'no-lonely-if': 'off',
45 'no-multi-spaces': ['error', {
46 exceptions: {
47 Property: true,
48 VariableDeclarator: true,
49 },
50 }],
51 'no-nested-ternary': 'off',
52 'no-param-reassign': 'off',
53 'no-plusplus': 'off',
54 'no-restricted-syntax': 'off',
55 'no-underscore-dangle': 'off',
56 'no-unused-vars': 'off',
57 'object-shorthand': ['error', 'never'],
58 'padding-line-between-statements': ['error', {
59 blankLine: 'always',
60 next: ['continue', 'break', 'export', 'return', 'throw'],
61 prev: '*',
62 }],
63 'prefer-destructuring': 'off',
64 'prefer-template': 'off',
65 'spaced-comment': ['error', 'always', {
66 block: {
67 balanced: true,
68 exceptions: ['*'],
69 markers: ['!'],
70 },
71 line: {
72 exceptions: ['-', '+'],
73 markers: ['/'],
74 },
75 }],
76 strict: 'off',
77 'unicorn/catch-error-name': 'off',
78 'unicorn/no-array-callback-reference': 'off',
79 'unicorn/no-lonely-if': 'off',
80 'unicorn/no-negated-condition': 'off',
81 'unicorn/no-null': 'off',
82 'unicorn/no-this-assignment': 'off',
83 'unicorn/numeric-separators-style': 'off',
84 'unicorn/prefer-array-find': 'off',
85 'unicorn/prefer-array-some': 'off', // https://github.com/sindresorhus/eslint-plugin-unicorn/issues/2007
86 'unicorn/prefer-module': 'off',
87 'unicorn/prevent-abbreviations': 'off',
88 'wrap-iife': ['error', 'inside'],
89
90 // TODO rules to be removed/fixed in v2.10.0 as fixes are not compatible with IE11
91 'guard-for-in': 'off', // refactor to "for of"
92 'no-restricted-globals': 'off',
93 'no-restricted-properties': 'off',
94 'no-var': 'off', // https://github.com/fomantic/Fomantic-UI/pull/2584
95 'one-var': 'off',
96 'prefer-const': 'off',
97 'prefer-exponentiation-operator': 'off',
98 'prefer-rest-params': 'off',
99 'prefer-spread': 'off',
100 'semi-style': 'off',
101 'unicorn/no-array-for-each': 'off',
102 'unicorn/no-for-loop': 'off', // autofixes to "for of"
103 'unicorn/prefer-code-point': 'off',
104 'unicorn/prefer-includes': 'off',
105 'unicorn/prefer-node-protocol': 'off', // needs Node 14+
106 'unicorn/prefer-number-properties': 'off',
107 'unicorn/prefer-optional-catch-binding': 'off',
108 'unicorn/prefer-prototype-methods': 'off',
109 'unicorn/prefer-reflect-apply': 'off',
110 'unicorn/prefer-spread': 'off',
111 'unicorn/prefer-top-level-await': 'off', // needs Node 14+
112 'vars-on-top': 'off',
113
114 // TODO rules with a lot of errors to be fixed manually, fix in a separate PR
115 eqeqeq: 'off', // about 20 errors to be fixed manually
116 'no-shadow': 'off', // about 220 errors to be fixed manually
117 'prefer-arrow-callback': 'off', // about 350 errors (all autofixable)
118 },
119 reportUnusedDisableDirectives: true,
120 globals: {
121 jQuery: true,
122 },
123};