Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.

Commit 2d0c683

Browse files
authored
Add api3/eslint-plugin-commons and apply lints (#461)
1 parent f480232 commit 2d0c683

20 files changed

Lines changed: 1831 additions & 146 deletions

.changeset/fresh-foxes-carry.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@api3/chains': patch
3+
---
4+
5+
Use api3/eslint-plugin-commons and apply lints

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
dist/
22
node_modules/
3+
coverage/
4+
jest.config.js
5+
.eslintrc.js

.eslintrc.js

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,16 @@ module.exports = {
33
es6: true,
44
node: true,
55
},
6-
parser: '@typescript-eslint/parser',
7-
extends: [
8-
'eslint:recommended',
9-
'plugin:@typescript-eslint/recommended',
10-
'plugin:@typescript-eslint/eslint-recommended',
11-
'plugin:import/recommended',
12-
'plugin:import/typescript',
13-
],
14-
plugins: ['@typescript-eslint', 'import'],
6+
extends: ['plugin:@api3/eslint-plugin-commons/universal', 'plugin:@api3/eslint-plugin-commons/jest'],
7+
parserOptions: {
8+
project: ['./tsconfig.json', './tsconfig.eslint.json'],
9+
},
1510
rules: {
1611
// TypeScript
1712
'@typescript-eslint/ban-ts-comment': 0,
1813
'@typescript-eslint/ban-ts-ignore': 0,
1914
'@typescript-eslint/ban-types': 0,
2015
'@typescript-eslint/camelcase': 0,
21-
'@typescript-eslint/explicit-function-return-type': 0,
22-
'@typescript-eslint/explicit-module-boundary-types': 0,
23-
// Turning off, because it conflicts with prettier
24-
'@typescript-eslint/indent': ['off'],
25-
'@typescript-eslint/no-empty-function': 0,
26-
'@typescript-eslint/no-explicit-any': 0,
27-
'@typescript-eslint/no-non-null-assertion': 0,
28-
// Leave vars as 'all' to force everything to be handled when pattern matching
29-
// Variables can be ignored by prefixing with an '_'
30-
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_', vars: 'all' }],
31-
'@typescript-eslint/no-use-before-define': 0,
32-
'@typescript-eslint/no-var-requires': 0,
3316

3417
// eslint-plugin-import
3518
'import/namespace': [2, { allowComputed: true }],
@@ -42,9 +25,6 @@ module.exports = {
4225
],
4326

4427
// ESLint
45-
'comma-dangle': [2, 'only-multiline'],
46-
eqeqeq: ['error', 'smart'],
47-
indent: 'off',
4828
'no-console': 0,
4929
'no-useless-escape': 0,
5030
semi: 2,
@@ -54,5 +34,16 @@ module.exports = {
5434
ignoreDeclarationSort: true,
5535
},
5636
],
37+
38+
// Jest
39+
'jest/no-conditional-in-test': 0,
40+
41+
// Unicorn
42+
'unicorn/prefer-string-replace-all': 0,
43+
'unicorn/prefer-type-error': 0,
44+
45+
// Lodash
46+
'lodash/prefer-lodash-typecheck': 0,
47+
'lodash/prefer-noop': 0,
5748
},
5849
};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"zod": "^3.23.8"
4141
},
4242
"devDependencies": {
43+
"@api3/eslint-plugin-commons": "3.0.0",
4344
"@api3/promise-utils": "^0.4.0",
4445
"@changesets/cli": "^2.27.7",
4546
"@slack/web-api": "^7.3.4",

0 commit comments

Comments
 (0)