UNPKG

2.46 kBJavaScriptView Raw
1/*
2 * Copyright 2018 Adobe. All rights reserved.
3 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License. You may obtain a copy
5 * of the License at http://www.apache.org/licenses/LICENSE-2.0
6 *
7 * Unless required by applicable law or agreed to in writing, software distributed under
8 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9 * OF ANY KIND, either express or implied. See the License for the specific language
10 * governing permissions and limitations under the License.
11 */
12
13module.exports = {
14 'env': {
15 'node': true,
16 'es6': true
17 },
18 // this is the root project for all sub modules. stop searching for any
19 // eslintrc files in parent directories.
20 'root': true,
21 'parserOptions': {
22 'sourceType': 'script',
23 'ecmaVersion': 10,
24 },
25 'plugins': [
26 'header',
27 ],
28 'extends': 'airbnb',
29 'rules': {
30 'strict': 0,
31
32 // Forbid multiple statements in one line
33 'max-statements-per-line': ["error", { "max": 1 }],
34
35 // Allow for-of loops
36 'no-restricted-syntax': ['error', 'ForInStatement', 'LabeledStatement', 'WithStatement'],
37
38 // Allow return before else & redundant else statements
39 'no-else-return': 'off',
40
41 // allow dangling underscores for 'fields'
42 'no-underscore-dangle': 'off',
43
44 // Allow marking variables unused using a underscore at the start
45 'no-unused-vars': ["error", {
46 "varsIgnorePattern": "^_.*$",
47 "argsIgnorePattern": "^_.*$",
48 "caughtErrorsIgnorePattern": "^_.*$"
49 }],
50
51
52 // enforce license header (todo: improve plugin to support patterns for multi-lines)
53 'header/header': [2, 'block', ['',
54 ' * Copyright 2019 Adobe. All rights reserved.',
55 ' * This file is licensed to you under the Apache License, Version 2.0 (the "License");',
56 ' * you may not use this file except in compliance with the License. You may obtain a copy',
57 ' * of the License at http://www.apache.org/licenses/LICENSE-2.0',
58 ' *',
59 ' * Unless required by applicable law or agreed to in writing, software distributed under',
60 ' * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS',
61 ' * OF ANY KIND, either express or implied. See the License for the specific language',
62 ' * governing permissions and limitations under the License.',
63 ' ',
64 ]]
65 }
66};