shared eslint config for musement projects
You'll first need to install ESLint and Prettier:
$ npm i [email protected] [email protected] --save-dev
Next, install @musement/eslint-plugin
:
$ npm install @musement/eslint-plugin --save-dev
Add plugin:@musement/SELECTED_CONFIG
to the extends section of your .eslintrc.*
configuration file.
{
"extends": ["plugin:@musement/library"]
}
{
"extends": ["plugin:@musement/vue"]
}
{
"extends": ["plugin:@musement/nuxt3"]
}
{
"extends": ["plugin:@musement/nuxt"]
}
If your app supports Server Side Rendering (ssr: true
in nuxt.config.js), enable node
environment.
{
"extends": [
"plugin:@musement/nuxt"
],
"env": {
"browser": true,
"node": true
}
}
If your app implements custom server middleware, you can disable browser
environment for that directory by using override option.
{
"extends": [
"plugin:@musement/nuxt"
],
"env": {
"browser": true,
"node": true
},
"overrides": [
{
"files": ["server-middleware/**"],
"env": {
"browser": false,
"node": true
}
}
]
}
{
"extends": ["plugin:@musement/react"]
}
VSCode developers can add these settings to the project's settings (.vscode/settings.json
) to use this plugin correctly and to avoid conflicts with other user's settings:
{
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}