|
| 1 | +/** |
| 2 | + * © Copyright IBM Corporation 2020. All Rights Reserved. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | +module.exports = { |
| 17 | + 'env': { |
| 18 | + 'node': true, |
| 19 | + }, |
| 20 | + 'plugins': ['node', 'prettier', 'header'], |
| 21 | + 'extends': [ |
| 22 | + 'eslint:recommended', |
| 23 | + 'google', |
| 24 | + 'plugin:node/recommended', |
| 25 | + 'prettier', |
| 26 | + 'plugin:import/errors', |
| 27 | + 'plugin:import/warnings', |
| 28 | + 'plugin:import/typescript', |
| 29 | + ], |
| 30 | + 'rules': { |
| 31 | + 'prettier/prettier': ['error', { 'singleQuote': true, 'printWidth': 100 }], |
| 32 | + 'prefer-const': 'error', |
| 33 | + 'prefer-rest-params': 'off', // https://github.com/mysticatea/eslint-plugin-node/issues/63 |
| 34 | + // The rest of these override rules that are enabled by one of the configs we extend but not compatible with current codebase |
| 35 | + // todo: fix issues and then remove overrides here |
| 36 | + 'valid-jsdoc': 'off', // too many issues; drowns out everything else |
| 37 | + 'camelcase': 'off', // todo: determine if we should keep this off globally, or disable it on a per-line basis |
| 38 | + 'import/extensions': 'off', |
| 39 | + 'header/header': [ |
| 40 | + 2, |
| 41 | + 'block', |
| 42 | + [ |
| 43 | + '*', |
| 44 | + { |
| 45 | + pattern: |
| 46 | + ' * © Copyright IBM Corporation 20\\d\\d(?:, 20\\d\\d)?\\. All Rights Reserved\\.', |
| 47 | + template: ' * © Copyright IBM Corporation 2020. All Rights Reserved.', |
| 48 | + }, |
| 49 | + ' *', |
| 50 | + ' * Licensed under the Apache License, Version 2.0 (the "License");', |
| 51 | + ' * you may not use this file except in compliance with the License.', |
| 52 | + ' * You may obtain a copy of the License at', |
| 53 | + ' *', |
| 54 | + ' * http://www.apache.org/licenses/LICENSE-2.0', |
| 55 | + ' *', |
| 56 | + ' * Unless required by applicable law or agreed to in writing, software', |
| 57 | + ' * distributed under the License is distributed on an "AS IS" BASIS,', |
| 58 | + ' * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.', |
| 59 | + ' * See the License for the specific language governing permissions and', |
| 60 | + ' * limitations under the License.', |
| 61 | + ' ', |
| 62 | + ], |
| 63 | + ], |
| 64 | + }, |
| 65 | + settings: { |
| 66 | + 'import/resolver': { |
| 67 | + node: { |
| 68 | + paths: ['lib', 'test'], |
| 69 | + extensions: ['.js', '.ts'], |
| 70 | + moduleDirectory: ['node_modules'], |
| 71 | + }, |
| 72 | + }, |
| 73 | + }, |
| 74 | +}; |
0 commit comments