how to override extended eslint config

hi i am using antfu's eslint config (https://github.com/antfu/eslint-config). here's my .eslintrc.cjs
process.env.ESLINT_TSCONFIG = 'tsconfig.json'

/** @type {import("eslint").Linter.Config} */
const config = {
root: true,
extends: '@antfu',
}

module.exports = config
process.env.ESLINT_TSCONFIG = 'tsconfig.json'

/** @type {import("eslint").Linter.Config} */
const config = {
root: true,
extends: '@antfu',
}

module.exports = config
now i want to override a rule to use double quotes instead of single quotes. the readme says i can override it by adding it to a rules field. so i added it like this:
const config = {
root: true,
extends: '@antfu',
rules: {
quotes: ['error', 'double'],
},
}
const config = {
root: true,
extends: '@antfu',
rules: {
quotes: ['error', 'double'],
},
}
but instead of overriding, its actually enforcing both the rules. https://this-vegetable.is-from.space/Code_53HG4zHeSp.gif
Solution:
looks like his config isn't properly configured
Jump to solution
11 Replies
nexxel
nexxel14mo ago
how do i fix this
nexxel
nexxel14mo ago
nexxel
nexxel14mo ago
hmm now there's no errors but there's also no errors for using single quotes don't think its working :( lemme try adding the files thing okay now its allowing both single and double quotes eslint is so weird <:P_veryweary:827162432778141706>
Solution
julius
julius14mo ago
looks like his config isn't properly configured
julius
julius14mo ago
it's fighting with typescript eslint need to override both rules @nexxel that is what eslint-config-prettier is doing for prettier - makes sure the rules aren't conflicting
nexxel
nexxel14mo ago
lemme try that julius you're a legend that worked that makes sense, im not using prettier at all in this project
nexxel
nexxel14mo ago
thank you again
julius
julius14mo ago
Yea im just saying that he has 2 plugins that conflicts so overriding one makes the other one fail ☺️
nexxel
nexxel14mo ago
is this worth opening an issue/pr for?
julius
julius14mo ago
Maybe - it certainly decreases the modifiability of the preset