|
| 1 | +/** |
| 2 | + * @license |
| 3 | + * Copyright 2021 Google LLC |
| 4 | + * |
| 5 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | + * you may not use this file except in compliance with the License. |
| 7 | + * You may obtain a copy of the License at |
| 8 | + * |
| 9 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | + * |
| 11 | + * Unless required by applicable law or agreed to in writing, software |
| 12 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | + * See the License for the specific language governing permissions and |
| 15 | + * limitations under the License. |
| 16 | + */ |
| 17 | + |
| 18 | +module.exports = { |
| 19 | + extends: '../../config/.eslintrc.js', |
| 20 | + parserOptions: { |
| 21 | + project: 'tsconfig.json', |
| 22 | + // to make vscode-eslint work with monorepo |
| 23 | + // https://github.com/typescript-eslint/typescript-eslint/issues/251#issuecomment-463943250 |
| 24 | + tsconfigRootDir: __dirname |
| 25 | + }, |
| 26 | + plugins: ['import'], |
| 27 | + rules: { |
| 28 | + 'no-console': ['error', { allow: ['warn', 'error'] }], |
| 29 | + '@typescript-eslint/no-unused-vars': [ |
| 30 | + 'error', |
| 31 | + { |
| 32 | + varsIgnorePattern: '^_', |
| 33 | + args: 'none' |
| 34 | + } |
| 35 | + ], |
| 36 | + 'import/order': [ |
| 37 | + 'error', |
| 38 | + { |
| 39 | + 'groups': [ |
| 40 | + 'builtin', |
| 41 | + 'external', |
| 42 | + 'internal', |
| 43 | + 'parent', |
| 44 | + 'sibling', |
| 45 | + 'index' |
| 46 | + ], |
| 47 | + 'newlines-between': 'always', |
| 48 | + 'alphabetize': { 'order': 'asc', 'caseInsensitive': true } |
| 49 | + } |
| 50 | + ] |
| 51 | + }, |
| 52 | + overrides: [ |
| 53 | + { |
| 54 | + files: ['**/*.d.ts'], |
| 55 | + rules: { |
| 56 | + 'camelcase': 'off', |
| 57 | + 'import/no-duplicates': 'off', |
| 58 | + '@typescript-eslint/no-explicit-any': 'off', |
| 59 | + '@typescript-eslint/no-unused-vars': 'off' |
| 60 | + } |
| 61 | + }, |
| 62 | + { |
| 63 | + files: ['**/*.test.ts', '**/test/**/*.ts'], |
| 64 | + rules: { |
| 65 | + '@typescript-eslint/no-explicit-any': 'error' |
| 66 | + } |
| 67 | + }, |
| 68 | + { |
| 69 | + files: ['scripts/*.ts'], |
| 70 | + rules: { |
| 71 | + 'import/no-extraneous-dependencies': 'off', |
| 72 | + '@typescript-eslint/no-require-imports': 'off' |
| 73 | + } |
| 74 | + } |
| 75 | + ] |
| 76 | +}; |
0 commit comments