This repository has been archived by the owner on Jan 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnodejs.js
49 lines (45 loc) · 1.6 KB
/
nodejs.js
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
module.exports = {
extends: ['airbnb-base', 'airbnb-typescript/base', './lib/shared'],
settings: { 'import/resolver': { 'babel-module': { extensions: ['.ts'] } } },
rules: {
// set up naming convention rules
'@typescript-eslint/naming-convention': [
'error',
// camelCase for everything not otherwise indicated
{ selector: 'default', format: ['camelCase'] },
// allow known default exclusions
{ selector: 'default', filter: { regex: '^(_id|__v|_raw)$', match: true }, format: null },
// allow variables to be camelCase or UPPER_CASE
{ selector: 'variable', format: ['camelCase', 'UPPER_CASE'] },
// allow known variable exclusions
{ selector: 'variable', filter: { regex: '^(_id|__v|_raw)$', match: true }, format: null },
// GraphQL variables PascalCase
{ selector: 'variable', filter: { regex: '^.*Gql$', match: true }, format: ['PascalCase'] },
// do not enforce format on property names
{ selector: 'property', format: null },
// PascalCase for classes and TypeScript keywords
{
selector: ['typeLike'],
format: ['PascalCase'],
},
// allow trailing ASC and DESC on enumerations
{ selector: 'enumMember', filter: { regex: '^.*?_(ASC|DESC)$', match: true }, format: null },
],
},
overrides: [
{
files: ['**/*.ts'],
rules: {
// enforce return types on module boundaries
'@typescript-eslint/explicit-module-boundary-types': 'error',
},
},
{
files: ['**/*.types.ts', '**/types/*.ts', '**/*.schema.ts', '**/instances/**'],
rules: {
'import/prefer-default-export': 'off',
'import/no-default-export': 'error',
},
},
],
};