Bruno Predot

Modification de la config de eslint avec la suppression de tout ce qui concerne …

…prettier, suppression du module @nuxt/eslint, contenant le module eslint/recommanded, et remplacemant par le module @antfu/eslint-config, plus complet et simple .
module.exports = {
// https://dev.to/tao/adding-eslint-and-prettier-to-nuxt-3-2023-5bg
root: true,
extends: ["@nuxtjs/eslint-config", "plugin:prettier/recommended"],
extends: ["@nuxtjs/eslint-config"],
env: {
browser: true,
node: true,
... ...
node_modules
logs
*.log*
.output
.nuxt
.nitro
.cache
dist
.gitignore
.env
.env.*
!.env.example
CHANGELOG.md
CHANGELOG_RELEASE.md
.idea
\ No newline at end of file
{
"semi": true,
"trailingComma": "all",
"singleQuote": false,
"printWidth": 120,
"arrowParens": "always",
"useTabs": false,
"tabWidth": 2
}
// @ts-check
import withNuxt from "./.nuxt/eslint.config.mjs";
import js from "@eslint/js";
import eslintPluginVue from "eslint-plugin-vue";
import ts from "typescript-eslint";
import antfu from "@antfu/eslint-config";
const TsConfigRecommended = ts.configs.recommended;
export default antfu({
// Type of the project. 'lib' for libraries, the default is 'app'
type: "app",
export default withNuxt(
// Your custom configs here
js.configs.recommended,
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
...TsConfigRecommended,
...eslintPluginVue.configs["flat/recommended"],
{
files: ["*.vue", "**/*.vue"],
languageOptions: {
parserOptions: {
parser: "@typescript-eslint/parser",
},
},
rules: {
"vue/multi-word-component-names": "off",
},
// Enable stylistic formatting rules
// stylistic: true,
// Or customize the stylistic rules
stylistic: {
indent: 2, // 4, or 'tab'
semi: true,
stylistic: true,
quotes: "double", // 'single' or 'double'
},
// your custom flat configs go here, for example:
// {
// files: ['**/*.ts', '**/*.tsx'],
// rules: {
// 'no-console': 'off' // allow console.log in TypeScript files
// }
// },
// {
// ...
// }
);
// TypeScript and Vue are autodetected, you can also explicitly enable them:
typescript: true,
vue: true,
// Disable jsonc and yaml support
jsonc: false,
markdown: false,
yaml: false,
// `.eslintignore` is no longer supported in Flat config, use `ignores` instead
ignores: [
"**/fixtures",
"**/.cache",
"**/.data",
"**/.gitignore",
"**/.env",
"**/.env.dist",
"**/.output",
"**/.nitro",
"**/.nuxt",
"**/assets",
"**/dist",
"**/logs",
"**/node_modules",
"**/public",
"**/server",
],
});
// Ancienne config eslint.
// import withNuxt from "./.nuxt/eslint.config.mjs";
// import js from "@eslint/js";
// import eslintPluginVue from "eslint-plugin-vue";
// import ts from "typescript-eslint";
//
// const TsConfigRecommended = ts.configs.recommended;
//
// export default withNuxt(
// // Your custom configs here
// js.configs.recommended,
// // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// // @ts-expect-error
// ...TsConfigRecommended,
// ...eslintPluginVue.configs["flat/recommended"],
// {
// files: ["*.vue", "**/*.vue"],
// languageOptions: {
// parserOptions: {
// parser: "@typescript-eslint/parser",
// },
// },
// rules: {
// "vue/multi-word-component-names": "off",
// },
// },
// // your custom flat configs go here, for example:
// // {
// // files: ['**/*.ts', '**/*.tsx'],
// // rules: {
// // 'no-console': 'off' // allow console.log in TypeScript files
// // }
// // },
// // {
// // ...
// // }
// );
... ...
import process from "node:process";
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
compatibilityDate: "2024-11-01",
... ... @@ -28,7 +30,6 @@ export default defineNuxtConfig({
},
modules: [
"@nuxt/eslint",
"@nuxt/icon",
"@nuxt/image",
"@nuxt/test-utils/module",
... ...
This diff could not be displayed because it is too large.
... ... @@ -10,14 +10,11 @@
"preview": "nuxt preview",
"postinstall": "nuxt prepare",
"lint:js": "eslint --ext \".ts,.vue\" . --fix",
"lint:prettier": "prettier --write \"{components,pages,plugins,middleware,layouts,composables,assets}/**/*.{js,jsx,ts,tsx,vue,html,css,scss,json,md}\" .",
"lint": "npm run lint:js && npm run lint:prettier",
"format": "prettier --write \"{components,pages,plugins,middleware,layouts,composables,assets}/**/*.{js,jsx,ts,tsx,vue,html,css,scss,json,md}\" --list-different .",
"lintfix": "npm run format && npm run lint:js",
"lint": "npm run lint:js",
"lintfix": "eslint . --fix",
"test": "vitest"
},
"dependencies": {
"@nuxt/eslint": "^1.3.0",
"@nuxt/icon": "^1.12.0",
"@nuxt/image": "^1.10.0",
"@nuxt/scripts": "^0.11.6",
... ... @@ -42,16 +39,14 @@
"vuetify-nuxt-module": "^0.18.6"
},
"devDependencies": {
"@antfu/eslint-config": "^4.13.0",
"@nuxt/test-utils": "^3.17.2",
"@nuxtjs/tailwindcss": "^6.13.2",
"@typescript-eslint/parser": "^8.32.1",
"@vue/test-utils": "^2.4.6",
"eslint-config-prettier": "^10.1.2",
"eslint-plugin-prettier": "^5.2.6",
"happy-dom": "^17.4.4",
"jsdom": "^26.1.0",
"playwright-core": "^1.52.0",
"prettier": "^3.5.3",
"typescript-eslint": "^8.32.1",
"vitest": "^3.1.2",
"vue-eslint-parser": "^10.1.3"
... ...