|
| 1 | +/* eslint-disable @typescript-eslint/no-var-requires */ |
| 2 | +/* |
| 3 | +Copyright 2025 Adobe. All rights reserved. |
| 4 | +This file is licensed to you under the Apache License, Version 2.0 (the "License"); |
| 5 | +you may not use this file except in compliance with the License. You may obtain a copy |
| 6 | +of the License at http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | +
|
| 8 | +Unless required by applicable law or agreed to in writing, software distributed under |
| 9 | +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS |
| 10 | +OF ANY KIND, either express or implied. See the License for the specific language |
| 11 | +governing permissions and limitations under the License. |
| 12 | +*/ |
| 13 | + |
| 14 | +const path = require('path'); |
| 15 | + |
| 16 | +module.exports = { |
| 17 | + root: true, |
| 18 | + plugins: [ |
| 19 | + '@typescript-eslint', |
| 20 | + 'notice', |
| 21 | + '@spectrum-web-components', |
| 22 | + 'import', |
| 23 | + 'require-extensions', |
| 24 | + ], |
| 25 | + env: { |
| 26 | + browser: true, |
| 27 | + node: true, |
| 28 | + es6: true, |
| 29 | + }, |
| 30 | + parser: '@typescript-eslint/parser', |
| 31 | + parserOptions: { |
| 32 | + ecmaVersion: 2020, |
| 33 | + sourceType: 'module', |
| 34 | + }, |
| 35 | + rules: { |
| 36 | + curly: ['error', 'all'], |
| 37 | + 'no-debugger': 2, |
| 38 | + 'no-console': [ |
| 39 | + 'error', |
| 40 | + { |
| 41 | + allow: ['warn', 'error'], |
| 42 | + }, |
| 43 | + ], |
| 44 | + 'import/extensions': [ |
| 45 | + 'error', |
| 46 | + 'ignorePackages', |
| 47 | + { |
| 48 | + ts: 'never', |
| 49 | + }, |
| 50 | + ], |
| 51 | + 'import/prefer-default-export': 'off', |
| 52 | + '@spectrum-web-components/prevent-argument-names': [ |
| 53 | + 'error', |
| 54 | + ['e', 'ev', 'evt', 'err'], |
| 55 | + ], |
| 56 | + 'notice/notice': [ |
| 57 | + 'error', |
| 58 | + { |
| 59 | + mustMatch: 'Copyright [0-9]{0,4} Adobe. All rights reserved.', |
| 60 | + templateFile: path.join(__dirname, 'config/license.js'), |
| 61 | + }, |
| 62 | + ], |
| 63 | + 'sort-imports': [ |
| 64 | + 'error', |
| 65 | + { |
| 66 | + ignoreCase: true, |
| 67 | + ignoreDeclarationSort: true, |
| 68 | + ignoreMemberSort: false, |
| 69 | + allowSeparatedGroups: false, |
| 70 | + }, |
| 71 | + ], |
| 72 | + 'lit-a11y/click-events-have-key-events': [ |
| 73 | + 'error', |
| 74 | + { |
| 75 | + allowList: [ |
| 76 | + 'sp-button', |
| 77 | + 'sp-action-button', |
| 78 | + 'sp-checkbox', |
| 79 | + 'sp-radio', |
| 80 | + 'sp-switch', |
| 81 | + 'sp-menu-item', |
| 82 | + 'sp-clear-button', |
| 83 | + 'sp-underlay', |
| 84 | + ], |
| 85 | + }, |
| 86 | + ], |
| 87 | + }, |
| 88 | + extends: [ |
| 89 | + 'eslint:recommended', |
| 90 | + 'plugin:@typescript-eslint/recommended', |
| 91 | + 'plugin:prettier/recommended', |
| 92 | + 'plugin:lit-a11y/recommended', |
| 93 | + 'plugin:require-extensions/recommended', |
| 94 | + ], |
| 95 | + overrides: [ |
| 96 | + { |
| 97 | + files: ['scripts/*'], |
| 98 | + rules: { |
| 99 | + 'no-console': ['off'], |
| 100 | + }, |
| 101 | + }, |
| 102 | + ], |
| 103 | +}; |
0 commit comments