Welcome to mirror list, hosted at ThFree Co, Russian Federation.

.eslintrc.js - github.com/nasa/openmct.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 26e807490899fed5d5a7bddcd2c9102ee5191392 (plain)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
const LEGACY_FILES = ["example/**"];
module.exports = {
    "env": {
        "browser": true,
        "es6": true,
        "jasmine": true,
        "amd": true
    },
    "globals": {
        "_": "readonly"
    },
    "extends": [
        "eslint:recommended",
        "plugin:compat/recommended",
        "plugin:vue/recommended",
        "plugin:you-dont-need-lodash-underscore/compatible"
    ],
    "parser": "vue-eslint-parser",
    "parserOptions": {
        "parser": "@babel/eslint-parser",
        "requireConfigFile": false,
        "allowImportExportEverywhere": true,
        "ecmaVersion": 2015,
        "ecmaFeatures": {
            "impliedStrict": true
        }
    },
    "rules": {
        "you-dont-need-lodash-underscore/omit": "off",
        "you-dont-need-lodash-underscore/throttle": "off",
        "you-dont-need-lodash-underscore/flatten": "off",
        "you-dont-need-lodash-underscore/get": "off",
        "no-bitwise": "error",
        "curly": "error",
        "eqeqeq": "error",
        "guard-for-in": "error",
        "no-extend-native": "error",
        "no-inner-declarations": "off",
        "no-use-before-define": ["error", "nofunc"],
        "no-caller": "error",
        "no-irregular-whitespace": "error",
        "no-new": "error",
        "no-shadow": "error",
        "no-undef": "error",
        "no-unused-vars": [
            "error",
            {
                "vars": "all",
                "args": "none"
            }
        ],
        "no-console": "off",
        "no-trailing-spaces": "error",
        "space-before-function-paren": [
            "error",
            {
                "anonymous": "always",
                "asyncArrow": "always",
                "named": "never"
            }
        ],
        "array-bracket-spacing": "error",
        "space-in-parens": "error",
        "space-before-blocks": "error",
        "comma-dangle": "error",
        "eol-last": "error",
        "new-cap": [
            "error",
            {
                "capIsNew": false,
                "properties": false
            }
        ],
        "dot-notation": "error",
        "indent": ["error", 4],

        // https://eslint.org/docs/rules/no-case-declarations
        "no-case-declarations": "error",
        // https://eslint.org/docs/rules/max-classes-per-file
        "max-classes-per-file": ["error", 1],
        // https://eslint.org/docs/rules/no-eq-null
        "no-eq-null": "error",
        // https://eslint.org/docs/rules/no-eval
        "no-eval": "error",
        // https://eslint.org/docs/rules/no-floating-decimal
        "no-floating-decimal": "error",
        // https://eslint.org/docs/rules/no-implicit-globals
        "no-implicit-globals": "error",
        // https://eslint.org/docs/rules/no-implied-eval
        "no-implied-eval": "error",
        // https://eslint.org/docs/rules/no-lone-blocks
        "no-lone-blocks": "error",
        // https://eslint.org/docs/rules/no-loop-func
        "no-loop-func": "error",
        // https://eslint.org/docs/rules/no-new-func
        "no-new-func": "error",
        // https://eslint.org/docs/rules/no-new-wrappers
        "no-new-wrappers": "error",
        // https://eslint.org/docs/rules/no-octal-escape
        "no-octal-escape": "error",
        // https://eslint.org/docs/rules/no-proto
        "no-proto": "error",
        // https://eslint.org/docs/rules/no-return-await
        "no-return-await": "error",
        // https://eslint.org/docs/rules/no-script-url
        "no-script-url": "error",
        // https://eslint.org/docs/rules/no-self-compare
        "no-self-compare": "error",
        // https://eslint.org/docs/rules/no-sequences
        "no-sequences": "error",
        // https://eslint.org/docs/rules/no-unmodified-loop-condition
        "no-unmodified-loop-condition": "error",
        // https://eslint.org/docs/rules/no-useless-call
        "no-useless-call": "error",
        // https://eslint.org/docs/rules/wrap-iife
        "wrap-iife": "error",
        // https://eslint.org/docs/rules/no-nested-ternary
        "no-nested-ternary": "error",
        // https://eslint.org/docs/rules/switch-colon-spacing
        "switch-colon-spacing": "error",
        // https://eslint.org/docs/rules/no-useless-computed-key
        "no-useless-computed-key": "error",
        // https://eslint.org/docs/rules/rest-spread-spacing
        "rest-spread-spacing": ["error"],
        // https://eslint.org/docs/rules/no-var
        "no-var": "error",
        // https://eslint.org/docs/rules/one-var
        "one-var": ["error", "never"],
        // https://eslint.org/docs/rules/default-case-last
        "default-case-last": "error",
        // https://eslint.org/docs/rules/default-param-last
        "default-param-last": "error",
        // https://eslint.org/docs/rules/grouped-accessor-pairs
        "grouped-accessor-pairs": "error",
        // https://eslint.org/docs/rules/no-constructor-return
        "no-constructor-return": "error",
        // https://eslint.org/docs/rules/array-callback-return
        "array-callback-return": "error",
        // https://eslint.org/docs/rules/no-invalid-this
        "no-invalid-this": "error", // Believe this one actually surfaces some bugs
        // https://eslint.org/docs/rules/func-style
        "func-style": ["error", "declaration"],
        // https://eslint.org/docs/rules/no-unused-expressions
        "no-unused-expressions": "error",
        // https://eslint.org/docs/rules/no-useless-concat
        "no-useless-concat": "error",
        // https://eslint.org/docs/rules/radix
        "radix": "error",
        // https://eslint.org/docs/rules/require-await
        "require-await": "error",
        // https://eslint.org/docs/rules/no-alert
        "no-alert": "error",
        // https://eslint.org/docs/rules/no-useless-constructor
        "no-useless-constructor": "error",
        // https://eslint.org/docs/rules/no-duplicate-imports
        "no-duplicate-imports": "error",

        // https://eslint.org/docs/rules/no-implicit-coercion
        "no-implicit-coercion": "error",
        //https://eslint.org/docs/rules/no-unneeded-ternary
        "no-unneeded-ternary": "error",
        // https://eslint.org/docs/rules/semi
        "semi": ["error", "always"],
        // https://eslint.org/docs/rules/no-multi-spaces
        "no-multi-spaces": "error",
        // https://eslint.org/docs/rules/key-spacing
        "key-spacing": ["error", {
            "afterColon": true
        }],
        // https://eslint.org/docs/rules/keyword-spacing
        "keyword-spacing": ["error", {
            "before": true,
            "after": true
        }],
        // https://eslint.org/docs/rules/comma-spacing
        // Also requires one line code fix
        "comma-spacing": ["error", {
            "after": true
        }],
        //https://eslint.org/docs/rules/no-whitespace-before-property
        "no-whitespace-before-property": "error",
        // https://eslint.org/docs/rules/object-curly-newline
        "object-curly-newline": ["error", {
            "consistent": true,
            "multiline": true
        }],
        // https://eslint.org/docs/rules/object-property-newline
        "object-property-newline": "error",
        // https://eslint.org/docs/rules/brace-style
        "brace-style": "error",
        // https://eslint.org/docs/rules/no-multiple-empty-lines
        "no-multiple-empty-lines": ["error", {"max": 1}],
        // https://eslint.org/docs/rules/operator-linebreak
        "operator-linebreak": ["error", "before", {"overrides": {"=": "after"}}],
        // https://eslint.org/docs/rules/padding-line-between-statements
        "padding-line-between-statements": ["error", {
            "blankLine": "always",
            "prev": "multiline-block-like",
            "next": "*"
        }, {
            "blankLine": "always",
            "prev": "*",
            "next": "return"
        }],
        // https://eslint.org/docs/rules/space-infix-ops
        "space-infix-ops": "error",
        // https://eslint.org/docs/rules/space-unary-ops
        "space-unary-ops": ["error", {
            "words": true,
            "nonwords": false
        }],
        // https://eslint.org/docs/rules/arrow-spacing
        "arrow-spacing": "error",
        // https://eslint.org/docs/rules/semi-spacing
        "semi-spacing": ["error", {
            "before": false,
            "after": true
        }],

        "vue/html-indent": [
            "error",
            4,
            {
                "attribute": 1,
                "baseIndent": 0,
                "closeBracket": 0,
                "alignAttributesVertically": true,
                "ignores": []
            }
        ],
        "vue/html-self-closing": ["error",
            {
                "html": {
                    "void": "never",
                    "normal": "never",
                    "component": "always"
                },
                "svg": "always",
                "math": "always"
            }
        ],
        "vue/max-attributes-per-line": ["error", {
            "singleline": 1,
            "multiline": 1,
        }],
        "vue/first-attribute-linebreak": "error",
        "vue/multiline-html-element-content-newline": "off",
        "vue/singleline-html-element-content-newline": "off",
        "vue/multi-word-component-names": "off", // TODO enable, align with conventions
        "vue/no-mutating-props": "off"

    },
    "overrides": [
        {
            "files": LEGACY_FILES,
            "rules": {
                "no-unused-vars": [
                    "warn",
                    {
                        "vars": "all",
                        "args": "none",
                        "varsIgnorePattern": "controller"
                    }
                ],
                "no-nested-ternary": "off",
                "no-var": "off",
                "one-var": "off"
            }
        }
    ]
};