N
Nuxtβ€’4mo ago
rightnow

How to add Stylistic options like ident: 'tab', quotes: 'single', to eslint.config.mjs?

Hello! Is it possible to get stylistic options like stylistic: { indent: 'tab', quotes: 'single', semi: false, braceStyle: '1tbs', arrowParens: true, }, Inside the eslint.config.mjs that uses withNuxt function? I dont want to add it to the nuxt.config.ts if possible
5 Replies
Cetus πŸ”›πŸ”
Have you found a way to do it @rightnow ?
hiimmox
hiimmoxβ€’3mo ago
Nuxt ESLint
ESLint Module - Nuxt ESLint
All-in-one ESLint integration for Nuxt. It generates a project-aware ESLint flat config and provides the ability to optionally run ESLint check along side the dev server.
Cetus πŸ”›πŸ”
Bro did you read the message?
Omnislash
Omnislashβ€’2mo ago
Hello, I needed the same today, stumbled on your post while looking for an answer. If you still need it : Don't add the stylistic stuff in nuxt.config.ts Then in your eslint config :
import stylistic from '@stylistic/eslint-plugin'

export default withNuxt(
{
plugins: {
'@stylistic': stylistic,
},
rules: {
// etc
import stylistic from '@stylistic/eslint-plugin'

export default withNuxt(
{
plugins: {
'@stylistic': stylistic,
},
rules: {
// etc
You can now use stuff like this in your rules :
'@stylistic/object-curly-newline': ['warn', {
'multiline': true,
'consistent': true
}],
'@stylistic/object-curly-spacing': ['warn', 'always'],
'@stylistic/object-property-newline': ['warn', {
'allowAllPropertiesOnSameLine': true,
}],
'@stylistic/object-curly-newline': ['warn', {
'multiline': true,
'consistent': true
}],
'@stylistic/object-curly-spacing': ['warn', 'always'],
'@stylistic/object-property-newline': ['warn', {
'allowAllPropertiesOnSameLine': true,
}],
hope it helps πŸ™‚ you shouldn't have to install '@stylistic/eslint-plugin' because it's already done by nuxt when adding the eslint module, but if needed you can ofc npm i -D @stylistic/eslint-plugin
Cetus πŸ”›πŸ”
Thanks you!

Did you find this page helpful?