$ npm init nuxt-app myproject
create-nuxt-app v3.7.1
✨ Generating Nuxt.js project in myproject
? Project name: myproject
? Programming language: TypeScript
? Package manager: Npm
? UI framework: Vuetify.js
? Nuxt.js modules: Axios - Promise based HTTP client, Progressive Web App (PWA), Content - Git-based headless CMS
? Linting tools: ESLint, Prettier, Lint staged files, StyleLint
? Testing framework: Jest
? Rendering mode: Universal (SSR / SSG)
? Deployment target: Server (Node.js hosting)
? Development tools: jsconfig.json (Recommended for VS Code if you're not using typescript)
? Continuous integration: None
? Version control system: Git
$ cat nuxt.config.js
...
build: {
babel: {
babelrc: true,
}
}
...
$ cat package.json
...
"scripts": {
...
"generate": "nuxt generate",
"lint:js": "eslint --ext \".js,.vue\" --ignore-path .gitignore .",
"lint:js:fix": "eslint --ext \".js,.vue\" --ignore-path .gitignore . --fix",
"lint:style": "stylelint \"**/*.{vue,css}\" --ignore-path .gitignore",
"lint:style:fix": "stylelint \"**/*.{vue,css}\" --ignore-path .gitignore --fix",
"prepare": "husky install",
"lint": "npm run lint:js && npm run lint:style",
"lint:fix": "npm run lint:js:fix && npm run lint:style:fix",
"test": "jest"
},
...
$ npm install --save-dev eslint-plugin-prettier
$ npm install --save-dev @vue/eslint-config-prettier
$ rm .prettierrc
$ cat .eslintrc.js
...
extends: [
'@nuxtjs/eslint-config-typescript',
'plugin:nuxt/recommended',
'plugin:vue/recommended',
'prettier',
'plugin:prettier/recommended',
],
plugins: [],
// add your custom rules here
rules: {
'no-console': 'error',
'prettier/prettier': [
'error',
{
singleQuote: true,
semi: false,
},
],
},
...
$ npm run lint
$ npm run lint:fix
$ npm run test
$ npm run dev
$ npm run build
$ npm run start