|
| 1 | +/* Copyright 2017-present Samsung Electronics Co., Ltd. and other contributors |
| 2 | + * |
| 3 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | + * you may not use this file except in compliance with the License. |
| 5 | + * You may obtain a copy of the License at |
| 6 | + * |
| 7 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | + * |
| 9 | + * Unless required by applicable law or agreed to in writing, software |
| 10 | + * distributed under the License is distributed on an "AS IS" BASIS |
| 11 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | + * See the License for the specific language governing permissions and |
| 13 | + * limitations under the License. |
| 14 | + */ |
| 15 | + |
| 16 | +var es6 = { |
| 17 | + 'generator-star-spacing': [2, 'after'], |
| 18 | + 'no-var': 2, |
| 19 | + 'prefer-rest-params': 2, |
| 20 | + 'prefer-spread': 2, |
| 21 | + 'rest-spread-spacing': 2, |
| 22 | + 'yield-star-spacing': [2, 'after'], |
| 23 | +} |
| 24 | + |
| 25 | +var eslintRecommended = { |
| 26 | + 'no-console': 0, |
| 27 | + 'no-empty': 0, // TODO: remove this feature |
| 28 | +} |
| 29 | + |
| 30 | +var style = { |
| 31 | + 'no-multi-spaces': 2, |
| 32 | + 'no-multi-str': 2, |
| 33 | + 'array-bracket-spacing': [2, 'never'], |
| 34 | + 'block-spacing': [2, 'never'], |
| 35 | + 'brace-style': 2, |
| 36 | + 'comma-dangle': [2, 'always-multiline'], |
| 37 | + 'comma-spacing': 2, |
| 38 | + 'comma-style': 2, |
| 39 | + 'computed-property-spacing': 2, |
| 40 | + 'eol-last': 2, |
| 41 | + 'func-call-spacing': 2, |
| 42 | + 'key-spacing': 2, |
| 43 | + 'keyword-spacing': 2, |
| 44 | + 'linebreak-style': 2, |
| 45 | + 'no-multiple-empty-lines': [2, {max: 2}], |
| 46 | + 'no-tabs': 2, |
| 47 | + 'no-trailing-spaces': 2, |
| 48 | + 'semi-spacing': 2, |
| 49 | + 'space-before-blocks': 2, |
| 50 | + 'space-before-function-paren': [2, { |
| 51 | + anonymous: 'never', |
| 52 | + named: 'never', |
| 53 | + }], |
| 54 | + 'spaced-comment': [2, 'always'], |
| 55 | + 'switch-colon-spacing': 2, |
| 56 | + 'quotes': [2, 'single'], |
| 57 | +} |
| 58 | + |
| 59 | +var syntax = { |
| 60 | + 'no-plusplus': 0, |
| 61 | + 'guard-for-in': 2, |
| 62 | + 'no-caller': 2, |
| 63 | + 'no-extend-native': 2, |
| 64 | + 'no-new-wrappers': 2, |
| 65 | + 'new-cap': 2, |
| 66 | + 'no-array-constructor': 2, |
| 67 | + 'no-new-object': 2, |
| 68 | + 'semi': 2, |
| 69 | +} |
| 70 | + |
1 | 71 | module.exports = { |
2 | 72 | 'extends': 'eslint:recommended', |
3 | | - 'rules': { |
4 | | - 'no-console': 0, |
5 | | - 'no-constant-condition': 0, |
6 | | - 'no-empty': 0, |
7 | | - 'no-undef': 0, |
8 | | - 'no-unused-vars': 0, |
9 | | - 'no-plusplus': 0, |
10 | | - 'no-redeclare': 0, |
11 | | - } |
| 73 | + 'env': { |
| 74 | + 'node': true, |
| 75 | + 'es6': false, |
| 76 | + }, |
| 77 | + 'rules': Object.assign( |
| 78 | + eslintRecommended, |
| 79 | + style, |
| 80 | + syntax, |
| 81 | + { |
| 82 | + // Optional rules |
| 83 | + 'max-len': [2, { |
| 84 | + code: 80, |
| 85 | + tabWidth: 2, |
| 86 | + ignoreUrls: true, |
| 87 | + ignoreTemplateLiterals: true, |
| 88 | + ignoreRegExpLiterals: true |
| 89 | + }], |
| 90 | + }), |
12 | 91 | } |
0 commit comments