Skip to content

Commit 44600f4

Browse files
committed
remove manual rules, add airbnb-base & airbnb-typescript
1 parent f704a75 commit 44600f4

File tree

6 files changed

+396
-1290
lines changed

6 files changed

+396
-1290
lines changed

.eslintrc.js

Lines changed: 12 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -1,167 +1,29 @@
1-
// @ts-check
2-
3-
const OFF = 'off';
4-
const ERROR = 'error';
5-
const WARN = 'warn';
6-
7-
/** @type {import('eslint').ESLint.ConfigData} */
81
module.exports = {
9-
root: true,
2+
plugins: [
3+
'@typescript-eslint',
4+
],
5+
106
env: {
117
node: true,
128
},
13-
settings: {
14-
'import/resolver': {
15-
typescript: {
16-
alwaysTryTypes: true,
17-
},
18-
},
19-
},
20-
plugins: ['import'],
219
extends: [
22-
'plugin:node/recommended',
23-
'plugin:prettier/recommended',
24-
'plugin:import/recommended',
10+
'airbnb-base',
2511
],
26-
rules: {
27-
'no-console': WARN,
28-
'no-debugger': WARN,
29-
'max-len': [
30-
ERROR,
31-
120,
32-
4,
33-
{
34-
ignoreComments: true,
35-
ignoreUrls: true,
36-
ignoreStrings: true,
37-
ignoreTemplateLiterals: true,
38-
ignoreRegExpLiterals: true,
39-
},
40-
],
41-
curly: ERROR,
42-
'no-implicit-coercion': ERROR,
43-
'no-else-return': ERROR,
44-
'no-duplicate-imports': [ERROR, { includeExports: true }],
45-
'import/first': ERROR,
46-
'import/no-mutable-exports': ERROR,
47-
'import/no-self-import': ERROR,
48-
'import/no-named-default': ERROR,
49-
'import/no-relative-packages': ERROR,
50-
'import/no-unresolved': OFF,
51-
'import/order': [
52-
ERROR,
53-
{
54-
'newlines-between': 'always',
55-
pathGroups: [
56-
{ pattern: '@nestjs/**', group: 'builtin', position: 'after' },
57-
],
58-
groups: [
59-
['builtin', 'external'],
60-
'internal',
61-
'parent',
62-
'sibling',
63-
'type',
64-
'index',
65-
'object',
66-
],
67-
pathGroupsExcludedImportTypes: ['builtin'],
68-
alphabetize: {
69-
order: 'asc',
70-
caseInsensitive: false,
71-
},
72-
},
73-
],
74-
'import/no-cycle': OFF,
75-
'node/no-unsupported-features/es-syntax': OFF,
76-
'node/no-missing-import': OFF,
77-
'node/no-unpublished-import': OFF,
78-
'node/no-extraneous-import': OFF,
79-
},
12+
parser: '@typescript-eslint/parser',
13+
rules: {},
8014
overrides: [
8115
{
82-
parser: '@typescript-eslint/parser',
83-
files: ['*.ts', '*.tsx'],
84-
plugins: ['@typescript-eslint/eslint-plugin'],
8516
extends: [
17+
'airbnb-typescript/base',
8618
'plugin:@typescript-eslint/recommended',
87-
'plugin:import/typescript',
19+
'plugin:@typescript-eslint/recommended-requiring-type-checking',
8820
],
8921
parserOptions: {
90-
ecmaVersion: 2022,
91-
project: 'tsconfig.json',
22+
parser: '@typescript-eslint/parser',
23+
project: './tsconfig.json',
9224
tsconfigRootDir: __dirname,
93-
sourceType: 'module',
9425
},
95-
rules: {
96-
'@typescript-eslint/no-empty-function': [
97-
ERROR,
98-
{
99-
allow: ['arrowFunctions'],
100-
},
101-
],
102-
'@typescript-eslint/no-explicit-any': OFF,
103-
'@typescript-eslint/no-unused-vars': [
104-
ERROR,
105-
{
106-
vars: 'local',
107-
ignoreRestSiblings: false,
108-
argsIgnorePattern: '^_',
109-
},
110-
],
111-
'@typescript-eslint/ban-ts-comment': [
112-
'error',
113-
{
114-
'ts-expect-error': 'allow-with-description',
115-
'ts-ignore': true,
116-
'ts-nocheck': true,
117-
'ts-check': false,
118-
minimumDescriptionLength: 5,
119-
},
120-
],
121-
'@typescript-eslint/member-ordering': [
122-
ERROR,
123-
{
124-
default: [
125-
'static-field',
126-
'static-get',
127-
'static-set',
128-
'static-method',
129-
'protected-decorated-field',
130-
'private-decorated-field',
131-
'public-decorated-field',
132-
'protected-instance-field',
133-
'private-instance-field',
134-
'public-instance-field',
135-
'constructor',
136-
'instance-field',
137-
'abstract-field',
138-
'instance-get',
139-
'abstract-get',
140-
'instance-set',
141-
'abstract-set',
142-
'instance-method',
143-
'protected-instance-method',
144-
'private-instance-method',
145-
'abstract-method',
146-
],
147-
},
148-
],
149-
'@typescript-eslint/array-type': [
150-
ERROR,
151-
{ default: 'generic', readonly: 'generic' },
152-
],
153-
'@typescript-eslint/no-base-to-string': ERROR,
154-
'@typescript-eslint/prefer-regexp-exec': ERROR,
155-
'@typescript-eslint/consistent-generic-constructors': ERROR,
156-
'@typescript-eslint/prefer-nullish-coalescing': ERROR,
157-
'@typescript-eslint/prefer-optional-chain': ERROR,
158-
'@typescript-eslint/no-unsafe-declaration-merging': OFF,
159-
'no-return-await': OFF,
160-
'@typescript-eslint/return-await': [ERROR, 'always'],
161-
},
162-
},
163-
{
164-
files: ['*rc.js', '*.config.js'],
26+
files: ['*.ts', '*tsx'],
16527
rules: {},
16628
},
16729
],

.prettierignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.prettierrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ make install
1414
make start
1515
```
1616

17-
<!-- TODO: Run tests -->
17+
## Run tests
18+
19+
```bash
20+
make test
21+
```
1822

1923
[![Hexlet Ltd. logo](https://raw.githubusercontent.com/Hexlet/assets/master/images/hexlet_logo128.png)](https://hexlet.io/?utm_source=github&utm_medium=link&utm_campaign=nodejs-package)
2024

0 commit comments

Comments
 (0)