-
Notifications
You must be signed in to change notification settings - Fork 73
Closed
Description
Reproduction:
- Operating System: `Linux`
- Node Version: `v18.5.0`
- Nuxt Version: `3.0.0-rc.5`
- Package Manager: `[email protected]`
- Builder: `vite`
- User Config: `ssr`, `srcDir`, `typescript`, `app`, `vite`, `modules`, `css`
- Runtime Modules: `@pinia/[email protected]`, `@nuxtjs/[email protected]`
- Build Modules: `-`
------------------------------
- Go to
nuxt.config.ts
and change srcDir tosrc/
- Move all folders, including layout and pages, under the
src/
directory. But keepeslintrc.json
in the root directory still.
I face issues that my layout/page components are not multiword components:
I can see this is because the ESLint rule is very particular about the pages/layout directory being at the top level:
It's fixable with the following override in eslintrc.json
, but feels dirty:
overrides: [
{
files: ['src/pages/**/*.vue', 'src/layouts/*.vue'],
rules: {
'vue/multi-word-component-names': 'off',
},
},
],
Edit: I suppose the issue disappears when moving eslintrc.json
in to the src/
directory however obviously this means the top level directory won't have eslintrules. So for the moment I've defined two eslintrc.json
files - I don't know if this is the intended way of doing this:
/eslintrc.json
:
{
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"parserOptions": {
"ecmaVersion": "latest",
"parser": "@typescript-eslint/parser",
"sourceType": "module"
},
"plugins": ["@typescript-eslint"]
}
/src/eslintrc.json
:
{
"extends": [
"eslint:recommended",
"plugin:vue/essential",
"plugin:@typescript-eslint/recommended",
"@nuxtjs/eslint-config-typescript",
"plugin:prettier/recommended"
],
"plugins": ["vue", "@typescript-eslint"]
}
Silinator
Metadata
Metadata
Assignees
Labels
No labels