|
| 1 | +import typescriptEslint from "@typescript-eslint/eslint-plugin"; |
| 2 | +import prettier from "eslint-plugin-prettier"; |
| 3 | +import globals from "globals"; |
| 4 | +import tsParser from "@typescript-eslint/parser"; |
| 5 | +import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'; |
| 6 | +import js from "@eslint/js"; |
| 7 | + |
| 8 | +export default [ |
| 9 | + { |
| 10 | + ignores: [ |
| 11 | + "eslint.config.mjs", |
| 12 | + "types/interfaces.d.ts", |
| 13 | + "test/types/index.test-d.ts", |
| 14 | + "**/generated/", |
| 15 | + "**/scripts/", |
| 16 | + "**/benchmark/", |
| 17 | + "**/docs/", |
| 18 | + "**/electron_demo/", |
| 19 | + ], |
| 20 | + }, |
| 21 | + { |
| 22 | + ...js.configs.recommended, |
| 23 | + files: ["lib/**/*.js", "index.js"], |
| 24 | + }, |
| 25 | + { |
| 26 | + rules: { |
| 27 | + 'no-dupe-class-members': 'off', |
| 28 | + }, |
| 29 | + }, |
| 30 | + { |
| 31 | + plugins: { |
| 32 | + "@typescript-eslint": typescriptEslint, |
| 33 | + }, |
| 34 | + languageOptions: { |
| 35 | + globals: { |
| 36 | + ...globals.node, |
| 37 | + }, |
| 38 | + parser: tsParser, |
| 39 | + ecmaVersion: "latest", |
| 40 | + sourceType: "module", |
| 41 | + }, |
| 42 | + files: ['types/*.d.ts'], |
| 43 | + rules: { |
| 44 | + ...typescriptEslint.configs.recommended.rules, |
| 45 | + "@typescript-eslint/no-explicit-any": "off", |
| 46 | + }, |
| 47 | + }, |
| 48 | + { |
| 49 | + plugins: { |
| 50 | + prettier, |
| 51 | + }, |
| 52 | + languageOptions: { |
| 53 | + globals: { |
| 54 | + ...globals.node, |
| 55 | + }, |
| 56 | + ecmaVersion: "latest", |
| 57 | + sourceType: "commonjs", |
| 58 | + }, |
| 59 | + files: ["lib/**/*.js", "rosidl_parser/**/*.js", "rosidl_gen/**/*.js", |
| 60 | + "rostsd_gen/**/*.js", "test/**/*.js", "example/**/*.js", "index.js"], |
| 61 | + rules: { |
| 62 | + ...eslintPluginPrettierRecommended.rules, |
| 63 | + }, |
| 64 | + } |
| 65 | +]; |
0 commit comments