You need to add unicorn in eslintConfig section for plugins
"plugins": [
"unicorn"
],
Reference: Usage Documentation
Answer from hendrixchord on Stack OverflowGitHub
github.com › sindresorhus › eslint-plugin-unicorn › blob › main › docs › rules › prevent-abbreviations.md
eslint-plugin-unicorn/docs/rules/prevent-abbreviations.md at main · sindresorhus/eslint-plugin-unicorn
"unicorn/prevent-abbreviations": [ "error", { "replacements": { "e": { "event": false }, "res": false, "cmd": { "command": true }, "errCb": { "handleError": true } } } ]
Author sindresorhus
GitHub
github.com › sindresorhus › eslint-plugin-unicorn › issues › 169
Rule proposal: Prevent abbreviations · Issue #169 · sindresorhus/eslint-plugin-unicorn
December 28, 2017 - Using complete words result in more readable code. Not everyone knows all your abbreviations. You only write code once, but it's read many times. For a start, we could go with these: err => error cb => callback opts => options str => str...
Author sindresorhus
Videos
GitHub
github.com › sindresorhus › eslint-plugin-unicorn › issues › 1497
unicorn/prevent-abbreviations cannot be turned off · Issue #1497 · sindresorhus/eslint-plugin-unicorn
March 14, 2021 - 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 ], }, ], }
Author Nantris
GitHub
github.com › sindresorhus › eslint-plugin-unicorn › blob › HEAD › docs › rules › prevent-abbreviations.md
eslint-plugin-unicorn/docs/rules/prevent-abbreviations.md at 66de41a8e395ce759abdf324b604c1babfa25425 · sindresorhus/eslint-plugin-unicorn
"unicorn/prevent-abbreviations": [ "error", { "replacements": { "e": { "event": false }, "res": false, "cmd": { "command": true }, "errCb": { "handleError": true } } } ]
Author sindresorhus
GitHub
github.com › faker-js › faker › pull › 3320
infra(unicorn): prevent-abbreviations by ST-DDT · Pull Request #3320 · faker-js/faker
This rule prevents the usage of abbreviations such as i => index, doc => document/documentation and many more.
Author faker-js
Top answer 1 of 2
1
You need to add unicorn in eslintConfig section for plugins
"plugins": [
"unicorn"
],
Reference: Usage Documentation
2 of 2
0
The accepted answer didn't work for me. After playing around with the configuration, I found the following to work:
"devDependencies": {
"xo": "^0.42.0"
},
"xo": {
"rules": {
"unicorn/prefer-module": 0
}
}
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 a bit more concise.
GitHub
github.com › NickPoulden › eslint-unicorn › blob › main › docs › rules › prevent-abbreviations.md
eslint-unicorn/docs/rules/prevent-abbreviations.md at main · NickPoulden/eslint-unicorn
"unicorn/prevent-abbreviations": [ "error", { "replacements": { "e": { "event": false }, "res": false, "cmd": { "command": true }, "errCb": { "handleError": true } } } ]
Author NickPoulden
UNPKG
app.unpkg.com › eslint-plugin-unicorn@34.0.1 › files › readme.md
eslint-plugin-unicorn
tent": "error", "unicorn/prefe...refer-ternary": "error", "unicorn/prefer-top-level-await": "off", "unicorn/prefer-type-error": "error", "unicorn/prevent-abbreviations": "error", "unicorn/require-array-join-separator": "error", "unicorn/require-number-to-fixed-digits-argument": ...
UNPKG
unpkg.com › browse › eslint-plugin-unicorn@23.0.0 › readme.md
eslint-plugin-unicorn
ror", "unicorn/numeric-separat...text-content": "error", "unicorn/prefer-trim-start-end": "error", "unicorn/prefer-type-error": "error", "unicorn/prevent-abbreviations": "error", "unicorn/string-content": "off", "unicorn/throw-new-error": "error" } } } ``` ## Rules - ...
GitHub
github.com › sindresorhus › eslint-plugin-unicorn › issues › 733
Autofix for unicorn/prevent-abbreviations and JSDoc · Issue #733 · sindresorhus/eslint-plugin-unicorn
January 2, 2020 - Autofix for unicorn/prevent-abbreviations must either don't touch function parameters or rename them in JSDoc when it exists or it will break a code (the JSDoc based type check, documentation, ...
Published May 17, 2020
Author tinovyatkin
GitHub
github.com › digitaldavenyc › eslint-plugin-unicorn › blob › master › docs › rules › prevent-abbreviations.md
eslint-plugin-unicorn/docs/rules/prevent-abbreviations.md at master · digitaldavenyc/eslint-plugin-unicorn
"unicorn/prevent-abbreviations": [ "error", { "replacements": { "e": { "event": false }, "res": false, "cmd": { "command": true }, "errCb": { "handleError": true } } } ]
Author digitaldavenyc
Npmfs
npmfs.com › package › eslint-plugin-unicorn › 10.0.0 › readme.md
npmfs - eslint-plugin-unicorn
"unicorn/prevent-abbreviations": "error", 73 · "unicorn/regex-shorthand": "error", 74 · "unicorn/throw-new-error": "error" 75 · } 76 · } 77 · } 78 · ``` 79 · 80 · 81 · ## Rules · 82 · 83 · - [catch-error-name](docs/rules/catch-error-name.md) - Enforce a specific parameter name in ...
GitHub
github.com › EvgenyOrekhov › eslint-config-hardcore › issues › 318
Configuration for rule "unicorn/prevent-abbreviations" is invalid · Issue #318 · EvgenyOrekhov/eslint-config-hardcore
March 16, 2021 - Hello After installing the plugin this error occurs "Configuration for rule "unicorn/prevent-abbreviations" is invalid" .eslintrc Error
Author arslanov-artur
IssueHunt
oss.issuehunt.io › r › sindresorhus › eslint-plugin-unicorn › issues › 1497
unicorn/prevent-abbreviations cannot be turned off #1497
sindresorhus/eslint-plugin-unicorn · The issue has been closed · Slapbox posted onGitHub · Update comments · Fund this Issue · $0.00 · Funded · Pull requests · Submit a pull request · AboutMission · SpectrumEmbed · FAQTerms of usePrivacy policyCode of conductCredits ·
Medium
medium.com › quadcode-life › improving-development-productivity-the-magic-of-a-unified-eslint-configuration-e32aa71b063b
Improving development productivity: the magic of a unified ESLint configuration | by Dmitrii Pashkevich | Quadcode | Medium
September 22, 2023 - /** eslint-plugin-unicorn */ module.exports = { // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-reduce.md "unicorn/no-array-reduce": "off", // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-module.md "unicorn/prefer-module": "off", // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-null.md "unicorn/no-null": "off", // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-undefined.md "unicorn/no-useless-undefined": "off", // https://github.com/sindresorhus/esl
Lightrun
lightrun.com › answers › sindresorhus-eslint-plugin-unicorn-unicornprevent-abbreviations-cannot-be-turned-off
unicorn/prevent-abbreviations cannot be turned off
The page you're looking for doesn't exist. Return to Debug Daily for real-world developer solutions.
CodeSandbox
codesandbox.io › s › eslint-plugin-unicorn-rm1wx
eslint-plugin-unicorn - CodeSandbox
Published Mar 18, 2020
Repository https://codesandbox.io/s/rm1wx