|
| 1 | +/** |
| 2 | + * Copyright 2025 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 | +import js from "@eslint/js"; |
| 18 | +import prettier from "eslint-config-prettier"; |
| 19 | + |
| 20 | +export default [ |
| 21 | + { ignores: ["**/dist/**", "**/node_modules/**", "**/releases/**", "**/.angular/**"] }, |
| 22 | + js.configs.recommended, |
| 23 | + prettier, |
| 24 | + { |
| 25 | + files: ["**/*.{js,jsx,ts,tsx}"], |
| 26 | + languageOptions: { |
| 27 | + ecmaVersion: 2022, |
| 28 | + sourceType: "module", |
| 29 | + parserOptions: { |
| 30 | + ecmaFeatures: { |
| 31 | + jsx: true, |
| 32 | + }, |
| 33 | + }, |
| 34 | + }, |
| 35 | + rules: { |
| 36 | + // Core JavaScript rules |
| 37 | + "no-unused-vars": ["error", { varsIgnorePattern: "^_", argsIgnorePattern: "^_" }], |
| 38 | + "no-console": "warn", |
| 39 | + "prefer-const": "error", |
| 40 | + "no-var": "error", |
| 41 | + |
| 42 | + // Security and best practices |
| 43 | + "no-debugger": "error", |
| 44 | + "no-eval": "error", |
| 45 | + "no-implied-eval": "error", |
| 46 | + "no-new-func": "error", |
| 47 | + "no-script-url": "error", |
| 48 | + "no-with": "error", |
| 49 | + |
| 50 | + // Modern JavaScript preferences |
| 51 | + "prefer-arrow-callback": "error", |
| 52 | + "prefer-template": "error", |
| 53 | + "prefer-destructuring": ["error", { object: true, array: false }], |
| 54 | + |
| 55 | + // Code quality |
| 56 | + eqeqeq: ["error", "always"], |
| 57 | + "no-duplicate-imports": "error", |
| 58 | + "no-useless-return": "error", |
| 59 | + "no-useless-concat": "error", |
| 60 | + }, |
| 61 | + }, |
| 62 | +]; |
0 commit comments