Website Structure
This commit is contained in:
parent
62812f2090
commit
71f0676a62
22365 changed files with 4265753 additions and 791 deletions
235
Frontend-Learner/node_modules/@nuxt/eslint-config/dist/chunks/formatters.mjs
generated
vendored
Normal file
235
Frontend-Learner/node_modules/@nuxt/eslint-config/dist/chunks/formatters.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,235 @@
|
|||
import { isPackageExists } from 'local-pkg';
|
||||
import { e as ensurePackages, i as interopDefault, p as parserPlain } from '../shared/eslint-config.CePp8IWi.mjs';
|
||||
import { b as GLOB_CSS, c as GLOB_POSTCSS, d as GLOB_SCSS, e as GLOB_LESS, f as GLOB_HTML, g as GLOB_XML, h as GLOB_SVG, i as GLOB_MARKDOWN, j as GLOB_GRAPHQL } from '../shared/eslint-config.CUi9znUC.mjs';
|
||||
import 'eslint-flat-config-utils';
|
||||
import 'eslint-config-flat-gitignore';
|
||||
import 'pathe';
|
||||
import 'node:process';
|
||||
import '@nuxt/eslint-plugin';
|
||||
import '@eslint/js';
|
||||
import 'globals';
|
||||
|
||||
function mergePrettierOptions(options, overrides = {}) {
|
||||
return {
|
||||
...options,
|
||||
...overrides,
|
||||
plugins: [
|
||||
...overrides.plugins || [],
|
||||
...options.plugins || []
|
||||
]
|
||||
};
|
||||
}
|
||||
async function formatters(options = {}, stylistic) {
|
||||
if (!options)
|
||||
return [];
|
||||
if (options === true) {
|
||||
const isPrettierPluginXmlInScope = isPackageExists("@prettier/plugin-xml");
|
||||
options = {
|
||||
css: true,
|
||||
graphql: true,
|
||||
html: true,
|
||||
// Markdown is disabled by default as many Nuxt projects use MDC with @nuxt/content,
|
||||
// where Prettier doesn't fully understand.
|
||||
markdown: false,
|
||||
svg: isPrettierPluginXmlInScope,
|
||||
xml: isPrettierPluginXmlInScope
|
||||
};
|
||||
}
|
||||
await ensurePackages([
|
||||
"eslint-plugin-format",
|
||||
options.xml || options.svg ? "@prettier/plugin-xml" : void 0
|
||||
]);
|
||||
const {
|
||||
indent,
|
||||
quotes,
|
||||
semi
|
||||
} = {
|
||||
indent: 2,
|
||||
quotes: "single",
|
||||
semi: false,
|
||||
...stylistic
|
||||
};
|
||||
const prettierOptions = Object.assign(
|
||||
{
|
||||
endOfLine: "auto",
|
||||
printWidth: 120,
|
||||
semi,
|
||||
singleQuote: quotes === "single",
|
||||
tabWidth: typeof indent === "number" ? indent : 2,
|
||||
trailingComma: "all",
|
||||
useTabs: indent === "tab"
|
||||
},
|
||||
options.prettierOptions || {}
|
||||
);
|
||||
const prettierXmlOptions = {
|
||||
xmlQuoteAttributes: "double",
|
||||
xmlSelfClosingSpace: true,
|
||||
xmlSortAttributesByKey: false,
|
||||
xmlWhitespaceSensitivity: "ignore"
|
||||
};
|
||||
const dprintOptions = Object.assign(
|
||||
{
|
||||
indentWidth: typeof indent === "number" ? indent : 2,
|
||||
quoteStyle: quotes === "single" ? "preferSingle" : "preferDouble",
|
||||
useTabs: indent === "tab"
|
||||
},
|
||||
options.dprintOptions || {}
|
||||
);
|
||||
const pluginFormat = await interopDefault(import('eslint-plugin-format'));
|
||||
const configs = [
|
||||
{
|
||||
name: "nuxt/formatter/setup",
|
||||
plugins: {
|
||||
format: pluginFormat
|
||||
}
|
||||
}
|
||||
];
|
||||
if (options.css) {
|
||||
configs.push(
|
||||
{
|
||||
files: [GLOB_CSS, GLOB_POSTCSS],
|
||||
languageOptions: {
|
||||
parser: parserPlain
|
||||
},
|
||||
name: "nuxt/formatter/css",
|
||||
rules: {
|
||||
"format/prettier": [
|
||||
"error",
|
||||
mergePrettierOptions(prettierOptions, {
|
||||
parser: "css"
|
||||
})
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
files: [GLOB_SCSS],
|
||||
languageOptions: {
|
||||
parser: parserPlain
|
||||
},
|
||||
name: "nuxt/formatter/scss",
|
||||
rules: {
|
||||
"format/prettier": [
|
||||
"error",
|
||||
mergePrettierOptions(prettierOptions, {
|
||||
parser: "scss"
|
||||
})
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
files: [GLOB_LESS],
|
||||
languageOptions: {
|
||||
parser: parserPlain
|
||||
},
|
||||
name: "nuxt/formatter/less",
|
||||
rules: {
|
||||
"format/prettier": [
|
||||
"error",
|
||||
mergePrettierOptions(prettierOptions, {
|
||||
parser: "less"
|
||||
})
|
||||
]
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
if (options.html) {
|
||||
configs.push({
|
||||
files: [GLOB_HTML],
|
||||
languageOptions: {
|
||||
parser: parserPlain
|
||||
},
|
||||
name: "nuxt/formatter/html",
|
||||
rules: {
|
||||
"format/prettier": [
|
||||
"error",
|
||||
mergePrettierOptions(prettierOptions, {
|
||||
parser: "html"
|
||||
})
|
||||
]
|
||||
}
|
||||
});
|
||||
}
|
||||
if (options.xml) {
|
||||
configs.push({
|
||||
files: [GLOB_XML],
|
||||
languageOptions: {
|
||||
parser: parserPlain
|
||||
},
|
||||
name: "nuxt/formatter/xml",
|
||||
rules: {
|
||||
"format/prettier": [
|
||||
"error",
|
||||
mergePrettierOptions({ ...prettierXmlOptions, ...prettierOptions }, {
|
||||
parser: "xml",
|
||||
plugins: [
|
||||
"@prettier/plugin-xml"
|
||||
]
|
||||
})
|
||||
]
|
||||
}
|
||||
});
|
||||
}
|
||||
if (options.svg) {
|
||||
configs.push({
|
||||
files: [GLOB_SVG],
|
||||
languageOptions: {
|
||||
parser: parserPlain
|
||||
},
|
||||
name: "nuxt/formatter/svg",
|
||||
rules: {
|
||||
"format/prettier": [
|
||||
"error",
|
||||
mergePrettierOptions({ ...prettierXmlOptions, ...prettierOptions }, {
|
||||
parser: "xml",
|
||||
plugins: [
|
||||
"@prettier/plugin-xml"
|
||||
]
|
||||
})
|
||||
]
|
||||
}
|
||||
});
|
||||
}
|
||||
if (options.markdown) {
|
||||
const formater = options.markdown === true ? "prettier" : options.markdown;
|
||||
configs.push({
|
||||
files: [GLOB_MARKDOWN],
|
||||
languageOptions: {
|
||||
parser: parserPlain
|
||||
},
|
||||
name: "nuxt/formatter/markdown",
|
||||
rules: {
|
||||
[`format/${formater}`]: [
|
||||
"error",
|
||||
formater === "prettier" ? mergePrettierOptions(prettierOptions, {
|
||||
embeddedLanguageFormatting: "off",
|
||||
parser: "markdown"
|
||||
}) : {
|
||||
...dprintOptions,
|
||||
language: "markdown"
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
}
|
||||
if (options.graphql) {
|
||||
configs.push({
|
||||
files: [GLOB_GRAPHQL],
|
||||
languageOptions: {
|
||||
parser: parserPlain
|
||||
},
|
||||
name: "nuxt/formatter/graphql",
|
||||
rules: {
|
||||
"format/prettier": [
|
||||
"error",
|
||||
mergePrettierOptions(prettierOptions, {
|
||||
parser: "graphql"
|
||||
})
|
||||
]
|
||||
}
|
||||
});
|
||||
}
|
||||
return configs;
|
||||
}
|
||||
|
||||
export { formatters };
|
||||
40
Frontend-Learner/node_modules/@nuxt/eslint-config/dist/chunks/import.mjs
generated
vendored
Normal file
40
Frontend-Learner/node_modules/@nuxt/eslint-config/dist/chunks/import.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import { r as resolveOptions } from '../shared/eslint-config.CePp8IWi.mjs';
|
||||
import 'eslint-flat-config-utils';
|
||||
import 'eslint-config-flat-gitignore';
|
||||
import 'pathe';
|
||||
import 'node:process';
|
||||
import 'local-pkg';
|
||||
import '@nuxt/eslint-plugin';
|
||||
import '@eslint/js';
|
||||
import 'globals';
|
||||
|
||||
async function imports(options) {
|
||||
const resolved = resolveOptions(options);
|
||||
if (resolved.features.import === false) {
|
||||
return [];
|
||||
}
|
||||
const importOptions = resolved.features.import === true ? {} : resolved.features.import || {};
|
||||
const plugin = importOptions.package === "eslint-plugin-import-lite" ? (await import('eslint-plugin-import-lite')).default : (await import('eslint-plugin-import-x')).default;
|
||||
return [
|
||||
{
|
||||
name: "nuxt/import/rules",
|
||||
plugins: {
|
||||
import: plugin
|
||||
},
|
||||
rules: {
|
||||
...importOptions.package === "eslint-plugin-import-lite" ? {
|
||||
"import/consistent-type-specifier-style": ["error", "top-level"]
|
||||
} : {},
|
||||
"import/first": "error",
|
||||
"import/no-duplicates": "error",
|
||||
"import/no-mutable-exports": "error",
|
||||
"import/no-named-default": "error",
|
||||
...resolved.features.stylistic ? {
|
||||
"import/newline-after-import": ["error", { count: 1 }]
|
||||
} : {}
|
||||
}
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
export { imports as default };
|
||||
47
Frontend-Learner/node_modules/@nuxt/eslint-config/dist/chunks/jsdoc.mjs
generated
vendored
Normal file
47
Frontend-Learner/node_modules/@nuxt/eslint-config/dist/chunks/jsdoc.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
import jsdocPlugin from 'eslint-plugin-jsdoc';
|
||||
import { G as GLOB_SRC, a as GLOB_VUE } from '../shared/eslint-config.CUi9znUC.mjs';
|
||||
import { r as resolveOptions } from '../shared/eslint-config.CePp8IWi.mjs';
|
||||
import 'eslint-flat-config-utils';
|
||||
import 'eslint-config-flat-gitignore';
|
||||
import 'pathe';
|
||||
import 'node:process';
|
||||
import 'local-pkg';
|
||||
import '@nuxt/eslint-plugin';
|
||||
import '@eslint/js';
|
||||
import 'globals';
|
||||
|
||||
function jsdoc(options = {}) {
|
||||
const resolved = resolveOptions(options);
|
||||
return [
|
||||
{
|
||||
name: "nuxt/tooling/jsdoc",
|
||||
files: [GLOB_SRC, GLOB_VUE],
|
||||
plugins: {
|
||||
jsdoc: jsdocPlugin
|
||||
},
|
||||
rules: {
|
||||
"jsdoc/check-access": "warn",
|
||||
"jsdoc/check-param-names": "warn",
|
||||
"jsdoc/check-property-names": "warn",
|
||||
"jsdoc/check-types": "warn",
|
||||
"jsdoc/empty-tags": "warn",
|
||||
"jsdoc/implements-on-classes": "warn",
|
||||
"jsdoc/no-defaults": "warn",
|
||||
"jsdoc/no-multi-asterisks": "warn",
|
||||
"jsdoc/require-param-name": "warn",
|
||||
"jsdoc/require-property": "warn",
|
||||
"jsdoc/require-property-description": "warn",
|
||||
"jsdoc/require-property-name": "warn",
|
||||
"jsdoc/require-returns-check": "warn",
|
||||
"jsdoc/require-returns-description": "warn",
|
||||
"jsdoc/require-yields-check": "warn",
|
||||
...resolved.features.stylistic ? {
|
||||
"jsdoc/check-alignment": "warn",
|
||||
"jsdoc/multiline-blocks": "warn"
|
||||
} : {}
|
||||
}
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
export { jsdoc as default };
|
||||
14
Frontend-Learner/node_modules/@nuxt/eslint-config/dist/chunks/regexp.mjs
generated
vendored
Normal file
14
Frontend-Learner/node_modules/@nuxt/eslint-config/dist/chunks/regexp.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import { configs } from 'eslint-plugin-regexp';
|
||||
import { G as GLOB_SRC, a as GLOB_VUE } from '../shared/eslint-config.CUi9znUC.mjs';
|
||||
|
||||
function regexp() {
|
||||
return [
|
||||
{
|
||||
...configs["flat/recommended"],
|
||||
name: "nuxt/tooling/regexp",
|
||||
files: [GLOB_SRC, GLOB_VUE]
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
export { regexp as default };
|
||||
12
Frontend-Learner/node_modules/@nuxt/eslint-config/dist/chunks/stylistic.mjs
generated
vendored
Normal file
12
Frontend-Learner/node_modules/@nuxt/eslint-config/dist/chunks/stylistic.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import stylistic$1 from '@stylistic/eslint-plugin';
|
||||
import { G as GLOB_SRC, a as GLOB_VUE } from '../shared/eslint-config.CUi9znUC.mjs';
|
||||
|
||||
const stylistic = (options) => {
|
||||
return {
|
||||
name: "nuxt/stylistic",
|
||||
files: [GLOB_SRC, GLOB_VUE],
|
||||
...stylistic$1.configs.customize(options)
|
||||
};
|
||||
};
|
||||
|
||||
export { stylistic as default };
|
||||
125
Frontend-Learner/node_modules/@nuxt/eslint-config/dist/chunks/typescript.mjs
generated
vendored
Normal file
125
Frontend-Learner/node_modules/@nuxt/eslint-config/dist/chunks/typescript.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,125 @@
|
|||
import parserTs from '@typescript-eslint/parser';
|
||||
export { default as parserTs } from '@typescript-eslint/parser';
|
||||
import pluginTs from '@typescript-eslint/eslint-plugin';
|
||||
export { default as pluginTs } from '@typescript-eslint/eslint-plugin';
|
||||
import { r as resolveOptions } from '../shared/eslint-config.CePp8IWi.mjs';
|
||||
import 'eslint-flat-config-utils';
|
||||
import 'eslint-config-flat-gitignore';
|
||||
import 'pathe';
|
||||
import 'node:process';
|
||||
import 'local-pkg';
|
||||
import '@nuxt/eslint-plugin';
|
||||
import '@eslint/js';
|
||||
import 'globals';
|
||||
|
||||
const getRulesFromConfigs = (config) => {
|
||||
const array = Array.isArray(config) ? config : [config];
|
||||
const object = array.reduce((acc, item) => {
|
||||
return { ...acc, ...item.rules };
|
||||
}, {});
|
||||
return object;
|
||||
};
|
||||
function typescript(options) {
|
||||
const resolved = resolveOptions(options);
|
||||
if (resolved.features.typescript === false) {
|
||||
return [];
|
||||
}
|
||||
const tsOptions = resolved.features.typescript === true ? {} : resolved.features.typescript;
|
||||
const strict = tsOptions.strict === false ? false : true;
|
||||
const tsconfigPath = tsOptions.tsconfigPath || void 0;
|
||||
return [
|
||||
{
|
||||
name: "nuxt/typescript/setup",
|
||||
plugins: {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
"@typescript-eslint": pluginTs
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "nuxt/typescript/rules",
|
||||
files: ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts", "**/*.vue"],
|
||||
languageOptions: {
|
||||
parser: parserTs,
|
||||
parserOptions: {
|
||||
extraFileExtensions: [".vue"],
|
||||
sourceType: "module",
|
||||
...tsconfigPath ? {
|
||||
projectService: {
|
||||
allowDefaultProject: ["./*.js"],
|
||||
defaultProject: tsconfigPath
|
||||
},
|
||||
tsconfigRootDir: process.cwd()
|
||||
} : {}
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
...getRulesFromConfigs(pluginTs.configs["flat/recommended"]),
|
||||
// Type-aware rules
|
||||
...tsconfigPath ? getRulesFromConfigs(pluginTs.configs["flat/recommended-type-checked-only"]) : {},
|
||||
// Strict rules
|
||||
...strict ? tsconfigPath ? getRulesFromConfigs(pluginTs.configs["flat/strict-type-checked-only"]) : getRulesFromConfigs(pluginTs.configs["flat/strict"]) : {},
|
||||
// Include typescript eslint rules in *.vue files
|
||||
// https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslint-recommended.ts
|
||||
"constructor-super": "off",
|
||||
// ts(2335) & ts(2377)
|
||||
"getter-return": "off",
|
||||
// ts(2378)
|
||||
"no-const-assign": "off",
|
||||
// ts(2588)
|
||||
"no-dupe-args": "off",
|
||||
// ts(2300)
|
||||
"no-dupe-class-members": "off",
|
||||
// ts(2393) & ts(2300)
|
||||
"no-dupe-keys": "off",
|
||||
// ts(1117)
|
||||
"no-func-assign": "off",
|
||||
// ts(2539)
|
||||
"no-import-assign": "off",
|
||||
// ts(2539) & ts(2540)
|
||||
"no-new-symbol": "off",
|
||||
// ts(7009)
|
||||
"no-obj-calls": "off",
|
||||
// ts(2349)
|
||||
"no-redeclare": "off",
|
||||
// ts(2451)
|
||||
"no-setter-return": "off",
|
||||
// ts(2408)
|
||||
"no-this-before-super": "off",
|
||||
// ts(2376)
|
||||
"no-undef": "off",
|
||||
// ts(2304)
|
||||
"no-unreachable": "off",
|
||||
// ts(7027)
|
||||
"no-unsafe-negation": "off",
|
||||
// ts(2365) & ts(2360) & ts(2358)
|
||||
"no-var": "error",
|
||||
// ts transpiles let/const to var, so no need for vars any more
|
||||
"prefer-const": "error",
|
||||
// ts provides better types with const
|
||||
"prefer-rest-params": "error",
|
||||
// ts provides better types with rest args over arguments
|
||||
"prefer-spread": "error",
|
||||
// ts transpiles spread to apply, so no need for manual apply
|
||||
"valid-typeof": "off",
|
||||
// ts(2367)
|
||||
"no-unused-vars": "off",
|
||||
// ts takes care of this
|
||||
"@typescript-eslint/no-non-null-assertion": "off",
|
||||
"@typescript-eslint/consistent-type-imports": ["error", {
|
||||
disallowTypeAnnotations: false,
|
||||
prefer: "type-imports"
|
||||
}],
|
||||
"@typescript-eslint/no-unused-vars": ["error", {
|
||||
args: "after-used",
|
||||
argsIgnorePattern: "^_",
|
||||
ignoreRestSiblings: true,
|
||||
vars: "all",
|
||||
varsIgnorePattern: "^_"
|
||||
}],
|
||||
"@typescript-eslint/no-import-type-side-effects": "error"
|
||||
}
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
export { typescript as default };
|
||||
44
Frontend-Learner/node_modules/@nuxt/eslint-config/dist/chunks/unicorn.mjs
generated
vendored
Normal file
44
Frontend-Learner/node_modules/@nuxt/eslint-config/dist/chunks/unicorn.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
import pluginUnicorn from 'eslint-plugin-unicorn';
|
||||
import { G as GLOB_SRC, a as GLOB_VUE } from '../shared/eslint-config.CUi9znUC.mjs';
|
||||
|
||||
function unicorn() {
|
||||
return [
|
||||
{
|
||||
name: "nuxt/tooling/unicorn",
|
||||
files: [GLOB_SRC, GLOB_VUE],
|
||||
plugins: {
|
||||
unicorn: pluginUnicorn
|
||||
},
|
||||
rules: {
|
||||
// Pass error message when throwing errors
|
||||
"unicorn/error-message": "error",
|
||||
// Uppercase regex escapes
|
||||
"unicorn/escape-case": "error",
|
||||
// Array.isArray instead of instanceof
|
||||
"unicorn/no-instanceof-array": "error",
|
||||
// Ban `new Array` as `Array` constructor's params are ambiguous
|
||||
"unicorn/no-new-array": "error",
|
||||
// Prevent deprecated `new Buffer()`
|
||||
"unicorn/no-new-buffer": "error",
|
||||
// Lowercase number formatting for octal, hex, binary (0x1'error' instead of 0X1'error')
|
||||
"unicorn/number-literal-case": "error",
|
||||
// textContent instead of innerText
|
||||
"unicorn/prefer-dom-node-text-content": "error",
|
||||
// includes over indexOf when checking for existence
|
||||
"unicorn/prefer-includes": "error",
|
||||
// Prefer using the node: protocol
|
||||
"unicorn/prefer-node-protocol": "error",
|
||||
// Prefer using number properties like `Number.isNaN` rather than `isNaN`
|
||||
"unicorn/prefer-number-properties": "error",
|
||||
// String methods startsWith/endsWith instead of more complicated stuff
|
||||
"unicorn/prefer-string-starts-ends-with": "error",
|
||||
// Enforce throwing type error when throwing error while checking typeof
|
||||
"unicorn/prefer-type-error": "error",
|
||||
// Use new when throwing error
|
||||
"unicorn/throw-new-error": "error"
|
||||
}
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
export { unicorn as default };
|
||||
156
Frontend-Learner/node_modules/@nuxt/eslint-config/dist/chunks/vue.mjs
generated
vendored
Normal file
156
Frontend-Learner/node_modules/@nuxt/eslint-config/dist/chunks/vue.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,156 @@
|
|||
import * as parserVue from 'vue-eslint-parser';
|
||||
import pluginVue from 'eslint-plugin-vue';
|
||||
import processorVueBlocks from 'eslint-processor-vue-blocks';
|
||||
import { mergeProcessors } from 'eslint-merge-processors';
|
||||
import { r as resolveOptions, a as removeUndefined } from '../shared/eslint-config.CePp8IWi.mjs';
|
||||
import 'eslint-flat-config-utils';
|
||||
import 'eslint-config-flat-gitignore';
|
||||
import 'pathe';
|
||||
import 'node:process';
|
||||
import 'local-pkg';
|
||||
import '@nuxt/eslint-plugin';
|
||||
import '@eslint/js';
|
||||
import 'globals';
|
||||
|
||||
const INLINE_ELEMENTS = ["a", "abbr", "audio", "b", "bdi", "bdo", "canvas", "cite", "code", "data", "del", "dfn", "em", "i", "iframe", "ins", "kbd", "label", "map", "mark", "noscript", "object", "output", "picture", "q", "ruby", "s", "samp", "small", "span", "strong", "sub", "sup", "svg", "time", "u", "var", "video"];
|
||||
async function vue(options) {
|
||||
const resolved = resolveOptions(options);
|
||||
const hasTs = resolved.features.typescript !== false;
|
||||
const parser = hasTs ? await import('./typescript.mjs').then((mod) => mod.parserTs) : void 0;
|
||||
const {
|
||||
indent = 2,
|
||||
commaDangle = "always-multiline"
|
||||
} = typeof resolved.features.stylistic === "boolean" ? {} : resolved.features.stylistic;
|
||||
const configs = [
|
||||
{
|
||||
name: "nuxt/vue/setup",
|
||||
plugins: {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
vue: pluginVue
|
||||
},
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
ecmaVersion: "latest",
|
||||
extraFileExtensions: [".vue"],
|
||||
parser,
|
||||
sourceType: "module",
|
||||
ecmaFeatures: {
|
||||
jsx: true
|
||||
}
|
||||
},
|
||||
// This allows Vue plugin to work with auto imports
|
||||
// https://github.com/vuejs/eslint-plugin-vue/pull/2422
|
||||
globals: {
|
||||
computed: "readonly",
|
||||
defineEmits: "readonly",
|
||||
defineExpose: "readonly",
|
||||
defineProps: "readonly",
|
||||
onMounted: "readonly",
|
||||
onUnmounted: "readonly",
|
||||
reactive: "readonly",
|
||||
ref: "readonly",
|
||||
shallowReactive: "readonly",
|
||||
shallowRef: "readonly",
|
||||
toRef: "readonly",
|
||||
toRefs: "readonly",
|
||||
watch: "readonly",
|
||||
watchEffect: "readonly"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "nuxt/vue/rules",
|
||||
files: [
|
||||
"**/*.vue"
|
||||
],
|
||||
languageOptions: {
|
||||
parser: parserVue
|
||||
},
|
||||
processor: options.features?.formatters ? mergeProcessors([
|
||||
pluginVue.processors[".vue"],
|
||||
processorVueBlocks({
|
||||
blocks: {
|
||||
styles: true
|
||||
}
|
||||
})
|
||||
]) : pluginVue.processors[".vue"],
|
||||
rules: {
|
||||
...pluginVue.configs.base.rules,
|
||||
...pluginVue.configs["flat/essential"].map((c) => c.rules).reduce((acc, c) => ({ ...acc, ...c }), {}),
|
||||
...pluginVue.configs["flat/strongly-recommended"].map((c) => c.rules).reduce((acc, c) => ({ ...acc, ...c }), {}),
|
||||
...pluginVue.configs["flat/recommended"].map((c) => c.rules).reduce((acc, c) => ({ ...acc, ...c }), {}),
|
||||
// Deprecated in favor of 'vue/block-order'
|
||||
"vue/component-tags-order": void 0,
|
||||
"vue/block-order": "warn",
|
||||
...resolved.features.stylistic ? {
|
||||
"vue/array-bracket-spacing": ["error", "never"],
|
||||
"vue/arrow-spacing": ["error", { after: true, before: true }],
|
||||
"vue/block-spacing": ["error", "always"],
|
||||
"vue/block-tag-newline": [
|
||||
"error",
|
||||
{
|
||||
multiline: "always",
|
||||
singleline: "always"
|
||||
}
|
||||
],
|
||||
"vue/brace-style": ["error", "stroustrup", { allowSingleLine: true }],
|
||||
"vue/html-indent": ["error", indent],
|
||||
"vue/html-quotes": ["error", "double"],
|
||||
"vue/comma-dangle": ["error", commaDangle],
|
||||
"vue/comma-spacing": ["error", { after: true, before: false }],
|
||||
"vue/comma-style": ["error", "last"],
|
||||
"vue/html-comment-content-spacing": [
|
||||
"error",
|
||||
"always",
|
||||
{ exceptions: ["-"] }
|
||||
],
|
||||
"vue/key-spacing": ["error", { afterColon: true, beforeColon: false }],
|
||||
"vue/keyword-spacing": ["error", { after: true, before: true }],
|
||||
"vue/object-curly-newline": "off",
|
||||
"vue/object-curly-spacing": ["error", "always"],
|
||||
"vue/object-property-newline": [
|
||||
"error",
|
||||
{ allowAllPropertiesOnSameLine: true }
|
||||
],
|
||||
"vue/one-component-per-file": "off",
|
||||
"vue/operator-linebreak": ["error", "before"],
|
||||
"vue/padding-line-between-blocks": ["error", "always"],
|
||||
"vue/quote-props": ["error", "consistent-as-needed"],
|
||||
"vue/require-default-prop": "off",
|
||||
"vue/space-in-parens": ["error", "never"],
|
||||
"vue/template-curly-spacing": "error",
|
||||
"vue/multiline-html-element-content-newline": ["error", {
|
||||
ignoreWhenEmpty: true,
|
||||
ignores: ["pre", "textarea", "router-link", "RouterLink", "nuxt-link", "NuxtLink", "u-link", "ULink", ...INLINE_ELEMENTS],
|
||||
allowEmptyLines: false
|
||||
}],
|
||||
"vue/singleline-html-element-content-newline": ["error", {
|
||||
ignoreWhenNoAttributes: true,
|
||||
ignoreWhenEmpty: true,
|
||||
ignores: ["pre", "textarea", "router-link", "RouterLink", "nuxt-link", "NuxtLink", "u-link", "ULink", ...INLINE_ELEMENTS],
|
||||
externalIgnores: []
|
||||
}]
|
||||
} : {
|
||||
// Disable Vue's default stylistic rules when stylistic is not enabled
|
||||
"vue/html-closing-bracket-newline": void 0,
|
||||
"vue/html-closing-bracket-spacing": void 0,
|
||||
"vue/html-indent": void 0,
|
||||
"vue/html-quotes": void 0,
|
||||
"vue/max-attributes-per-line": void 0,
|
||||
"vue/multiline-html-element-content-newline": void 0,
|
||||
"vue/mustache-interpolation-spacing": void 0,
|
||||
"vue/no-multi-spaces": void 0,
|
||||
"vue/no-spaces-around-equal-signs-in-attribute": void 0,
|
||||
"vue/singleline-html-element-content-newline": void 0
|
||||
}
|
||||
}
|
||||
}
|
||||
];
|
||||
for (const config of configs) {
|
||||
if (config.rules)
|
||||
config.rules = removeUndefined(config.rules);
|
||||
}
|
||||
return configs;
|
||||
}
|
||||
|
||||
export { vue as default };
|
||||
Loading…
Add table
Add a link
Reference in a new issue