This repository was archived by the owner on Jan 30, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbase.js
More file actions
193 lines (192 loc) · 5.73 KB
/
Copy pathbase.js
File metadata and controls
193 lines (192 loc) · 5.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
/**
* Custom config base for all projects.
*/
module.exports = {
env: {
node: true,
es2022: true,
},
plugins: ["unicorn", "promise", "@parcellab/eslint-plugin-no-require-assign"],
extends: [
"eslint:recommended",
"plugin:import/recommended",
"plugin:promise/recommended",
"plugin:unicorn/recommended",
"prettier",
],
rules: {
"promise/catch-or-return": ["error", { allowFinally: true }],
"unicorn/catch-error-name": [
"error",
{
ignore: ["^error\\d*$", "^err\\d*$"],
},
],
"@typescript-eslint/ban-ts-comment": "off",
"unicorn/import-style": "off",
"unicorn/no-array-for-each": "off",
"unicorn/no-await-expression-member": "off",
"unicorn/no-null": "off",
"unicorn/numeric-separators-style": "off",
"unicorn/prefer-number-properties": "off",
"unicorn/prefer-spread": "off",
"unicorn/prevent-abbreviations": [
"off",
{
extendDefaultReplacements: true,
// Extends the default list: https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/rules/shared/abbreviations.js
replacements: {
args: false,
abs: { absolute: true },
addr: { address: true },
alloc: { allocation: true },
alt: { alternative: true },
apiRes: { apiResponse: true },
avg: { average: true },
bg: { background: true },
bin: { binary: true },
buf: { buffer: true },
calc: { calculation: true },
cert: { certificate: true },
cfg: { configuration: true },
ch: { channel: true },
char: { character: true },
cmp: { compare: true },
cnt: { counter: true },
col: { column: true },
coord: { coordinate: true },
ctrl: { control: true },
diff: { difference: true },
fmt: { format: true },
gen: { generate: true },
hdr: { header: true },
hw: { hardware: true },
img: { image: true },
info: { information: true },
init: { initialization: true },
k: { key: true },
lang: { language: true },
lat: { latitude: true },
lon: { longitude: true },
math: { mathematics: true },
mem: { memory: true },
mid: { middle: true },
misc: { miscellaneous: true },
net: { network: true },
op: { operation: true },
os: { operatingSystem: true },
pic: { picture: true },
pos: { position: true },
pref: { preference: true },
proc: { process: true },
prof: { profiler: true },
props: false,
ptr: { pointer: true },
px: { pixel: true },
rand: { random: true },
recv: { receive: true },
rng: { range: true },
sel: { selection: true },
sem: { semaphore: true },
seq: { sequence: true },
sqrt: { squareRoot: true },
stat: { statistic: true },
ts: { timestamp: true },
},
allowList: {
// Single word variables
acc: true, // accumulator
app: true, // application
arg: true, // argument
args: true, // arguments
arr: true, // array
attr: true, // attribute
attrs: true, // attributes
auth: true, // authentication
btn: true, // button
cb: true, // callback
cmd: true, // command
conf: true, // config
ctx: true, // context
db: true, // database
dest: true, // destination
dev: true, // development
dir: true, // directory
dirs: true, // directories
doc: true, // document
docs: true, // documents
el: true, // element
elem: true, // element
env: true, // environment
envs: true, // environments
err: true, // error
expr: true, // expression
fn: true, // function
func: true, // function
id: true, // identifier
len: true, // length
lib: true, // library
max: true, // maximum
min: true, // minimum
msg: true, // message
num: true, // number
obj: true, // object
opts: true, // options
param: true, // parameter
params: true, // parameters
pkg: true, // package
prev: true, // previous
prod: true, // production
prop: true, // property
props: true, // properties
ref: true, // reference
refs: true, // references
req: true, // request
res: true, // response
ret: true, // return
src: true, // source
sync: true, // synchronization
tmp: true, // temporary
val: true, // value
var: true, // variable
vars: true, // variables
// Multiple word variables
customProps: true,
htmlDocs: true,
jsDocs: true,
isDev: true,
isDevMode: true,
isProd: true,
fetchArgs: true,
paramAuth: true,
rulesObj: true,
searchParams: true,
tokenParams: true,
},
},
],
},
overrides: [
{
/**
* Relax rules in config files
*/
files: [
"**/{commitlint,jest}.config.{j,t}s?(x)",
"**/webpack.*.{j,t}s",
"**/typedoc.js",
"**/.eslintrc.js",
"**/.stylelintrc.js",
],
rules: {
"unicorn/prefer-module": "off",
},
},
{
/**
* Include other file extensions other than the .js
*/
files: ["**/*.cjs"],
},
],
};