|
| 1 | +/** |
| 2 | + * Copyright 2023 Google LLC |
| 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 | + |
| 17 | +module.exports = { |
| 18 | + root: true, |
| 19 | + parser: '@typescript-eslint/parser', |
| 20 | + extends: [ |
| 21 | + 'eslint:recommended', |
| 22 | + 'plugin:@typescript-eslint/recommended', |
| 23 | + 'plugin:@typescript-eslint/recommended-requiring-type-checking', |
| 24 | + 'plugin:wc/recommended', |
| 25 | + 'plugin:lit/recommended', |
| 26 | + 'prettier' |
| 27 | + ], |
| 28 | + parserOptions: { |
| 29 | + ecmaVersion: 'latest', |
| 30 | + sourceType: 'module', |
| 31 | + tsconfigRootDir: __dirname, |
| 32 | + project: ['./tsconfig.json', './tsconfig.node.json'], |
| 33 | + extraFileExtensions: ['.cjs'] |
| 34 | + }, |
| 35 | + env: { |
| 36 | + es6: true, |
| 37 | + browser: true |
| 38 | + }, |
| 39 | + plugins: ['lit', '@typescript-eslint', 'prettier'], |
| 40 | + ignorePatterns: ['node_modules'], |
| 41 | + rules: { |
| 42 | + indent: 'off', |
| 43 | + 'linebreak-style': ['error', 'unix'], |
| 44 | + quotes: ['error', 'single', { avoidEscape: true }], |
| 45 | + 'prefer-const': ['error'], |
| 46 | + semi: ['error', 'always'], |
| 47 | + // 'max-len': [ |
| 48 | + // 'warn', |
| 49 | + // { |
| 50 | + // code: 80 |
| 51 | + // } |
| 52 | + // ], |
| 53 | + 'no-constant-condition': ['error', { checkLoops: false }], |
| 54 | + 'prettier/prettier': 2, |
| 55 | + '@typescript-eslint/ban-ts-comment': 'off', |
| 56 | + '@typescript-eslint/restrict-template-expressions': 'off', |
| 57 | + '@typescript-eslint/no-non-null-assertion': 'off', |
| 58 | + '@typescript-eslint/no-empty-function': 'off', |
| 59 | + '@typescript-eslint/no-unnecessary-type-assertion': 'off', |
| 60 | + '@typescript-eslint/no-unused-vars': [ |
| 61 | + 'warn', |
| 62 | + { |
| 63 | + argsIgnorePattern: '^_', |
| 64 | + varsIgnorePattern: '^_', |
| 65 | + caughtErrorsIgnorePattern: '^_' |
| 66 | + } |
| 67 | + ], |
| 68 | + 'no-self-assign': 'off' |
| 69 | + } |
| 70 | +}; |
0 commit comments