|
| 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 | + |
| 13 | +module.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 | + // Allow while (true) infinite loops |
| 33 | + 'no-constant-condition': ["error", { "checkLoops": false }], |
| 34 | + |
| 35 | + // Forbid multiple statements in one line |
| 36 | + 'max-statements-per-line': ["error", { "max": 1 }], |
| 37 | + |
| 38 | + // Allow for-of loops |
| 39 | + 'no-restricted-syntax': ['error', 'ForInStatement', 'LabeledStatement', 'WithStatement'], |
| 40 | + |
| 41 | + // Allow return before else & redundant else statements |
| 42 | + 'no-else-return': 'off', |
| 43 | + |
| 44 | + // allow dangling underscores for 'fields' |
| 45 | + 'no-underscore-dangle': ['error', {'allowAfterThis': true}], |
| 46 | + |
| 47 | + // enforce license header (todo: improve plugin to support patterns for multi-lines) |
| 48 | + 'header/header': [2, 'block', ['', |
| 49 | + ' * Copyright 2019 Adobe. All rights reserved.', |
| 50 | + ' * This file is licensed to you under the Apache License, Version 2.0 (the "License");', |
| 51 | + ' * you may not use this file except in compliance with the License. You may obtain a copy', |
| 52 | + ' * of the License at http://www.apache.org/licenses/LICENSE-2.0', |
| 53 | + ' *', |
| 54 | + ' * Unless required by applicable law or agreed to in writing, software distributed under', |
| 55 | + ' * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS', |
| 56 | + ' * OF ANY KIND, either express or implied. See the License for the specific language', |
| 57 | + ' * governing permissions and limitations under the License.', |
| 58 | + ' ', |
| 59 | + ]] |
| 60 | + } |
| 61 | +}; |
0 commit comments