question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

unicorn/prevent-abbreviations cannot be turned off

See original GitHub issue

Issue:

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:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Slapboxcommented, Aug 24, 2021

It’s because I was checking whether this was enabled by seeing if err was replaced with error, but using that particular replacement as a test case was flawed because that’s also handled by catch-error-name which I hadn’t realized provided functionally identical results in that case.

1reaction
yakov116commented, Aug 24, 2021

@Slapbox no need to make a new comment just edit the first one.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found