Skip to content

Commit

Permalink
fix: more tweaks to base and typescript config
Browse files Browse the repository at this point in the history
  • Loading branch information
xobotyi committed Aug 14, 2023
1 parent 128769b commit 28c11ff
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 7 deletions.
107 changes: 100 additions & 7 deletions base.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,105 @@ module.exports = {
rules: {
'no-use-extend-native/no-use-extend-native': 'error',

'unicorn/prevent-abbreviations': [
'error',
{
checkFilenames: false,
checkDefaultAndNamespaceImports: false,
checkShorthandImports: false,
extendDefaultReplacements: false,
replacements: {
whitelist: {
include: true,
},
blacklist: {
exclude: true,
},
master: {
main: true,
},
slave: {
secondary: true,
},
props: {
properties: false,
},

// Not part of `eslint-plugin-unicorn`
application: {
app: true,
},
applications: {
apps: true,
},

// Part of `eslint-plugin-unicorn`
arr: {
array: true,
},
e: {
error: true,
event: true,
},
el: {
element: true,
},
elem: {
element: true,
},
len: {
length: true,
},
msg: {
message: true,
},
num: {
number: true,
},
obj: {
object: true,
},
opts: {
options: true,
},
param: {
parameter: true,
},
params: {
parameters: true,
},
prev: {
previous: true,
},
req: {
request: true,
},
res: {
response: true,
result: true,
},
ret: {
returnValue: true,
},
str: {
string: true,
},
temp: {
temporary: true,
},
tmp: {
temporary: true,
},
val: {
value: true,
},
err: {
error: true,
},
},
},
],

'unicorn/better-regex': [
'error',
{
Expand All @@ -31,13 +130,7 @@ module.exports = {

'import/default': 'error',
'import/export': 'error',
'import/extensions': [
'error',
'always',
{
ignorePackages: true,
},
],
'import/extensions': ['error', 'ignorePackages'],
'import/first': 'error',

'import/namespace': [
Expand Down
8 changes: 8 additions & 0 deletions typescript.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ module.exports = {
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
},
],
'import/extensions': [
'error',
'ignorePackages',
{
ts: 'never',
tsx: 'never',
},
],
// Deviation from xo's config - we allow usage of null and empty array types.
'@typescript-eslint/ban-types': [
'error',
Expand Down

0 comments on commit 28c11ff

Please sign in to comment.