Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add api3/eslint-plugin-commons and apply lints #461

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fresh-foxes-carry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@api3/chains': patch
---

Use api3/eslint-plugin-commons and apply lints
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
dist/
node_modules/
coverage/
jest.config.js
.eslintrc.js
39 changes: 15 additions & 24 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,16 @@ module.exports = {
es6: true,
node: true,
},
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:import/recommended',
'plugin:import/typescript',
],
plugins: ['@typescript-eslint', 'import'],
extends: ['plugin:@api3/eslint-plugin-commons/universal', 'plugin:@api3/eslint-plugin-commons/jest'],
parserOptions: {
project: ['./tsconfig.json', './tsconfig.eslint.json'],
},
rules: {
// TypeScript
'@typescript-eslint/ban-ts-comment': 0,
'@typescript-eslint/ban-ts-ignore': 0,
'@typescript-eslint/ban-types': 0,
'@typescript-eslint/camelcase': 0,
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
// Turning off, because it conflicts with prettier
'@typescript-eslint/indent': ['off'],
'@typescript-eslint/no-empty-function': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-non-null-assertion': 0,
// Leave vars as 'all' to force everything to be handled when pattern matching
// Variables can be ignored by prefixing with an '_'
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_', vars: 'all' }],
'@typescript-eslint/no-use-before-define': 0,
'@typescript-eslint/no-var-requires': 0,

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

// ESLint
'comma-dangle': [2, 'only-multiline'],
eqeqeq: ['error', 'smart'],
indent: 'off',
'no-console': 0,
'no-useless-escape': 0,
semi: 2,
Expand All @@ -54,5 +34,16 @@ module.exports = {
ignoreDeclarationSort: true,
},
],

// Jest
'jest/no-conditional-in-test': 0,

// Unicorn
'unicorn/prefer-string-replace-all': 0,
'unicorn/prefer-type-error': 0,

// Lodash
'lodash/prefer-lodash-typecheck': 0,
'lodash/prefer-noop': 0,
},
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"zod": "^3.23.8"
},
"devDependencies": {
"@api3/eslint-plugin-commons": "3.0.0",
"@api3/promise-utils": "^0.4.0",
"@changesets/cli": "^2.27.7",
"@slack/web-api": "^7.3.4",
Expand Down
Loading