How to override rules and config rule severity(warn) not working
Closed this issue · 8 comments
Describe the bug
Hi author!
Here is my config for overriding your rules
export default sxzz(
{
rules: {
'no-console': 'warn',
},
},
{
vue: true,
prettier: true,
markdown: true,
unocss: true,
sortKeys: true,
},
)
I don't see any warning when I use, but rule severity(error) is fine
const a: any = 1
console.log(a)
Reproduction
Nothing
System Info
System:
OS: macOS 13.6.1
CPU: (8) arm64 Apple M1 Pro
Memory: 151.86 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.9.0 - ~/Library/Caches/fnm_multishells/76365_1701660609649/bin/node
npm: 10.1.0 - ~/Library/Caches/fnm_multishells/76365_1701660609649/bin/npm
pnpm: 8.11.0 - ~/Library/pnpm/pnpm
bun: 1.0.12 - ~/.bun/bin/bun
Browsers:
Safari: 16.6
Used Package Manager
pnpm
Validations
- Follow our Code of Conduct
- Read the Contributing Guide.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
- The provided reproduction is a minimal reproducible of the bug.
Run ESLint via CLI,
pnpm eslint .
And show the output.
It looks like it works well with ESLint, and could be caused by your IDE settings. Maybe you can provide a reproduction repo and I'll check it in my machine.
repo: https://github.com/hungify/nuxt-utils-auto-import-issue
sandbox: https://stackblitz.com/github/hungify/nuxt-utils-auto-import-issue?file=README.md
Also, I updated .vscode/settings.json
for support ESlint flat config
{
"editor.formatOnSave": true,
"eslint.experimental.useFlatConfig": true
}
My bad !
It is caused by "eslint.quiet": true
config
Thank you very much for helping me to find the stuck.
Sorry but my overriding your rules like this caused an error.
import { sxzz } from '@sxzz/eslint-config'
export default sxzz(
{
rules: {
'@typescript-eslint/no-unused-vars': 'error',
},
},
{
vue: true,
prettier: true,
markdown: true,
unocss: true,
sortKeys: true,
},
)
I'm new to this approach.
Normally I need to install @typescript-eslint
and put my rules to eslint.config.js
but this way just import and use.
import { sxzz, GLOB_TS, GLOB_TSX } from '@sxzz/eslint-config'
// ...
{
files: [GLOB_TS, GLOB_TSX],
rules: {
'@typescript-eslint/no-unused-vars': 'error',
},
},
typescript-eslint plugin is only applied for .ts and .tsx files.