Skip to content

Commit

Permalink
Revert "chore: Disabled unicorn/prevent-abbreviations rule (#260)" (#261
Browse files Browse the repository at this point in the history
)

This reverts commit 7884c89.
  • Loading branch information
gitstart-sourcegraph committed Aug 26, 2022
1 parent 7884c89 commit 1863da2
Showing 1 changed file with 51 additions and 1 deletion.
52 changes: 51 additions & 1 deletion .eslintrc.js
Expand Up @@ -277,10 +277,59 @@ module.exports = {
// which is extremely common and necessary to maintain type safety.
'a',
'b',
// caught by prevent-abbreviations below, avoid double-flagging
'e',
'i',
'ch',
],
},
],
'unicorn/prevent-abbreviations': 'off',
'unicorn/prevent-abbreviations': [
'error',
{
checkShorthandImports: false,
replacements: {
e: {
event: true,
error: true,
end: true, // as in e2e
},
i: { index: true },
idx: { index: true },
ch: { character: true },
j2d: { goToDefinition: true },
pos: { position: true },
opt: { options: true, option: true },
cmd: { command: true },
cmds: { commands: true },
loc: { location: true },
ext: { extension: true },
expr: { expression: true },
sub: { subscription: true },
subs: { subscriptions: true },
rect: { rectangle: true },
obs: { observable: true, observer: true },
resp: { response: true },
// When saving a document in a variable, we usually don't mean the the global document,
// but an extension API text document. Avoid shadowing suffixes.
doc: { document: false, textDocument: true },
// Never needed in our codebase, better to have an autofix for directory
dir: { direction: false },
// The meaning of rev vs ref is a common source of confusion.
// Spelling it out makes it clear.
rev: { revision: true },
// Allow since it's a React term
props: false,
func: false,
ref: false,
},
allowList: {
args: true, // arguments is special
fs: true, // NodeJS standard library
},
},
],

'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': 'off',
// New rules added to unicorn
Expand Down Expand Up @@ -474,6 +523,7 @@ module.exports = {
rules: {
'no-var': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'unicorn/prevent-abbreviations': 'off',
'id-length': 'off',
'import/no-default-export': 'off',
},
Expand Down

0 comments on commit 1863da2

Please sign in to comment.