|
| 1 | +module.exports = { |
| 2 | + env: { |
| 3 | + browser: true, |
| 4 | + es2021: true, |
| 5 | + node: true |
| 6 | + }, |
| 7 | + |
| 8 | + extends: [ |
| 9 | + "eslint:recommended", |
| 10 | + "plugin:compat/recommended", |
| 11 | + "plugin:editorconfig/all", |
| 12 | + "plugin:@typescript-eslint/recommended", |
| 13 | + "plugin:vue/vue3-recommended", |
| 14 | + "plugin:unicorn/recommended", |
| 15 | + "plugin:yml/standard", |
| 16 | + "plugin:vuejs-accessibility/recommended" |
| 17 | + ], |
| 18 | + |
| 19 | + ignorePatterns: [ "pnpm-lock.yaml", ".artifacts/*" ], |
| 20 | + overrides: [ |
| 21 | + { |
| 22 | + files: [ "*.ts", "*.vue" ], |
| 23 | + rules: { |
| 24 | + "no-undef": "off", |
| 25 | + }, |
| 26 | + }, |
| 27 | + |
| 28 | + // YAML/JSON files |
| 29 | + { |
| 30 | + files: [ "*.yaml", "*.yml" ], |
| 31 | + parser: "yaml-eslint-parser", |
| 32 | + }, |
| 33 | + |
| 34 | + // ESLint config |
| 35 | + { |
| 36 | + env: { |
| 37 | + node: true |
| 38 | + }, |
| 39 | + files: [ |
| 40 | + ".eslintrc.{js,cjs}" |
| 41 | + ], |
| 42 | + parserOptions: { |
| 43 | + sourceType: "script" |
| 44 | + }, |
| 45 | + rules: { |
| 46 | + "unicorn/prefer-module": "off", |
| 47 | + } |
| 48 | + } |
| 49 | + ], |
| 50 | + |
| 51 | + parserOptions: { |
| 52 | + ecmaVersion: "latest", |
| 53 | + parser: "@typescript-eslint/parser", |
| 54 | + sourceType: "module" |
| 55 | + }, |
| 56 | + |
| 57 | + plugins: [ |
| 58 | + "@typescript-eslint", |
| 59 | + "vue", |
| 60 | + "unicorn", |
| 61 | + "compat", |
| 62 | + "editorconfig", |
| 63 | + "simple-import-sort", |
| 64 | + "vuejs-accessibility" |
| 65 | + ], |
| 66 | + |
| 67 | + rules: { |
| 68 | + "sort-imports": "off", |
| 69 | + "quote-props": [ "error", "as-needed" ], |
| 70 | + quotes: [ |
| 71 | + "error", |
| 72 | + "double" |
| 73 | + ], |
| 74 | + semi: [ |
| 75 | + "error", |
| 76 | + "always" |
| 77 | + ], |
| 78 | + "simple-import-sort/imports": [ |
| 79 | + "error", |
| 80 | + { |
| 81 | + groups: [ |
| 82 | + [ |
| 83 | + // Internal |
| 84 | + "^\\u0000", |
| 85 | + "#imports", |
| 86 | + "#app", |
| 87 | + |
| 88 | + // Imports from @ |
| 89 | + "^@(/.*|$)", |
| 90 | + |
| 91 | + // Relative imports |
| 92 | + "^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$", |
| 93 | + "^\\.\\.(?!/?$)", "^\\.\\./?$", |
| 94 | + |
| 95 | + // Types |
| 96 | + "^@(t|/types)(/.*|$)", |
| 97 | + |
| 98 | + // Styles |
| 99 | + "^@(s|/styles)(/.*|$)", |
| 100 | + "^.+\\.s?css$" |
| 101 | + ] |
| 102 | + ] |
| 103 | + } |
| 104 | + ], |
| 105 | + "simple-import-sort/exports": "error", |
| 106 | + "vue/multi-word-component-names": "off", |
| 107 | + "object-curly-spacing": [ "error", "always" ], |
| 108 | + "array-bracket-spacing": [ "error", "always", { objectsInArrays: false }], |
| 109 | + "vue/component-name-in-template-casing": [ "error", "PascalCase", { |
| 110 | + registeredComponentsOnly: false, |
| 111 | + ignores: [] |
| 112 | + }], |
| 113 | + "unicorn/no-null": "off", |
| 114 | + "comma-spacing": [ "error", { before: false, after: true }], |
| 115 | + "vuejs-accessibility/aria-role": [ "error", { ignoreNonDOM: false }], |
| 116 | + "vuejs-accessibility/alt-text": [ |
| 117 | + "error", |
| 118 | + { |
| 119 | + elements: [ "img", "object", "area", "input[type=\"image\"]" ], |
| 120 | + components: [ "Image", "NuxtImage", "NuxtImg", "Img" ], |
| 121 | + img: [ "Image" ], |
| 122 | + object: [ "Object" ], |
| 123 | + area: [ "Area" ], |
| 124 | + "input[type=\"image\"]": [ "ImageInput" ] |
| 125 | + } |
| 126 | + ], |
| 127 | + } |
| 128 | +}; |
0 commit comments