unicorn/prevent-abbreviations cannot be turned off
See original GitHub issueIssue:
I was surprised to find that some rules seemingly cannot be turned off in conjunction with the recommended settings - but I’ve never seen this issue with any other plugin. Other rules disable fine, but not unicorn/prevent-abbreviations
.
- unicorn/prevent-abbreviations
I tried turning it off, and also ignoring all files, but it autofixes all cases anyway - for example, replacing err
with error
.
.eslintrc.js:
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react-redux/recommended',
'plugin:react-hooks/recommended',
'plugin:regexp/recommended',
'plugin:unicorn/recommended',
'airbnb',
'prettier',
],
plugins: [
'prettier',
'flowtype',
'import',
'compat',
'react',
'react-redux',
'react-hooks',
'@emotion/eslint-plugin',
'regexp',
'xss',
'unicorn',
],
rules: {
'unicorn/prevent-abbreviations': [
'off', // 'off' is ignored
{
extendDefaultReplacements: false, // If I'm understanding, this should achieve the desired end, but also doesn't work
ignore: [
/./, // 'ignore' is ignored
],
},
],
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Prevent abbreviations - sindresorhus/eslint-plugin-unicorn
Prevent abbreviations. This rule is enabled in the ✓ recommended config. This rule is automatically fixable by the --fix CLI option.
Read more >unicorn/prevent-abbreviations cannot be turned off #1497
Issue: I was surprised to find that some rules seemingly cannot be turned off in conjunction with the recommended settings - but I've...
Read more >How to disable unicorn/prefer-module in typescript?
I'm using all the defaults - just not ready to change ALL my doe to modules just yet. Thought I'd share since it's...
Read more >My Tags Glossary
Discreet: Wants to keep their private life private. This person may or may not be out about their LGBTQ identity or their kinks....
Read more >eslint-plugin-unicorn - npm Package Health Analysis
Looks like eslint-plugin-unicorn is missing a security policy. ... Enforce specifying rules to disable in eslint-disable comments.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s because I was checking whether this was enabled by seeing if
err
was replaced witherror
, but using that particular replacement as a test case was flawed because that’s also handled bycatch-error-name
which I hadn’t realized provided functionally identical results in that case.@Slapbox no need to make a new comment just edit the first one.