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
nexxelOP2y ago
how do i fix this
nexxel
nexxelOP2y ago
nexxel
nexxelOP2y 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
julius2y ago
looks like his config isn't properly configured
julius
julius2y 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
nexxelOP2y ago
lemme try that julius you're a legend that worked that makes sense, im not using prettier at all in this project
nexxel
nexxelOP2y ago
thank you again
julius
julius2y ago
Yea im just saying that he has 2 plugins that conflicts so overriding one makes the other one fail ☺️
nexxel
nexxelOP2y ago
is this worth opening an issue/pr for?
julius
julius2y ago
Maybe - it certainly decreases the modifiability of the preset
Want results from more Discord servers?
Add your server