Quentin
Quentin
CDCloudflare Developers
Created by Quentin on 7/12/2024 in #general-help
The Turnstile widget has an extra padding since few days
@Erisa Thanks !
3 replies
NNuxt
Created by Sanford on 4/1/2024 in #❓・help
Nuxt eslint module help
@Alejandro Mery @Sanford I succeeded just now !! I had succeeded with a small hack, but I had opened an issue here(https://github.com/nuxt/eslint/issues/387), and Antfu solved it just as quickly, So now it works !!! Here is my eslint.config.mjs:
import eslintConfigPrettier from 'eslint-config-prettier'
import prettierPlugin from 'eslint-plugin-prettier'
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
import withNuxt from './.nuxt/eslint.config.mjs'

export default withNuxt({
plugins: {
prettier: prettierPlugin
},
rules: {
// ...prettierPlugin.configs.recommended.rules,
...eslintConfigPrettier.rules,
...eslintPluginPrettierRecommended.rules
}
})
import eslintConfigPrettier from 'eslint-config-prettier'
import prettierPlugin from 'eslint-plugin-prettier'
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
import withNuxt from './.nuxt/eslint.config.mjs'

export default withNuxt({
plugins: {
prettier: prettierPlugin
},
rules: {
// ...prettierPlugin.configs.recommended.rules,
...eslintConfigPrettier.rules,
...eslintPluginPrettierRecommended.rules
}
})
You need to install: npm i -D eslint-config-prettier eslint-plugin-prettier @nuxt/eslint then of course add '@nuxt/eslint' inside nuxt.modules array And, now all the errors are handled with Prettier !!
7 replies
NNuxt
Created by Sanford on 4/1/2024 in #❓・help
Nuxt eslint module help
Hey, @Sanford @Alejandro Mery how did you manage to use prettier plugin with the new eslint module ? I didn't succeed to import a plugins in eslint.config.mjs... I tried to import the same thing as in my .eslintrc but when I look in vscode's eslint output I get errors that say: "Error: Key "plugins": Key "0": Expected an object." My eslint.config.mjs:
import withNuxt from './.nuxt/eslint.config.mjs'

export default withNuxt({
plugins: ['prettier'],
extends: ['prettier', 'plugin:prettier/recommended'],
rules: {
'@stylistic/quotes': ['error', 'single', { avoidEscape: true }],
'@stylistic/brace-style': ['error', '1tbs'],
'@stylistic/operator-linebreak': ['error', 'before'],
}
})
import withNuxt from './.nuxt/eslint.config.mjs'

export default withNuxt({
plugins: ['prettier'],
extends: ['prettier', 'plugin:prettier/recommended'],
rules: {
'@stylistic/quotes': ['error', 'single', { avoidEscape: true }],
'@stylistic/brace-style': ['error', '1tbs'],
'@stylistic/operator-linebreak': ['error', 'before'],
}
})
If I comment on plugins and extends the module works but prettier just uses VsCode settings and not ESlint rules.
7 replies