Skip to content

Commit e02f7f5

Browse files
committed
chore: drop "eslint-plugin-prettier" dependency
- `npm run lint` now checks formatting with prettier and eslint - `npm run fixlint` now fixes formatting with `prettier --write` and `eslint --fix` - lint-staged also uses `npm run fixlint` to keep things consistent - ci seems to already check formatting with prettier and eslint - added jsdoc type hints to the eslintrc.js file for autocompletion Eslint now uses a blocklist instead of allowlist for ignoring files. It might be easier to not accidentally ignore any new files with this approach. Solves #445
1 parent 366d6a7 commit e02f7f5

File tree

3 files changed

+17
-137
lines changed

3 files changed

+17
-137
lines changed

.eslintrc.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
1+
/**
2+
* @type {import('eslint').Linter.LegacyConfig}
3+
*/
14
module.exports = {
25
extends: ['airbnb-base', 'plugin:@typescript-eslint/recommended', 'prettier'],
3-
plugins: ['unicorn', 'import', 'prettier', '@typescript-eslint'],
6+
plugins: ['unicorn', 'import', '@typescript-eslint'],
47
parser: '@typescript-eslint/parser',
58
parserOptions: {
69
project: './tsconfig.json',
710
ecmaVersion: 'latest',
811
sourceType: 'module',
912
},
13+
ignorePatterns: [
14+
'.eslintrc.js',
15+
'packages/*/lib/',
16+
'packages/*/bin/',
17+
'packages/neovim/scripts/',
18+
'packages/integration-tests/__tests__/',
19+
'examples/rplugin/node/',
20+
'packages/example-plugin/',
21+
'packages/example-plugin-decorators/',
22+
],
1023
env: {
1124
node: true,
1225
es2024: true,
@@ -66,9 +79,6 @@ module.exports = {
6679
'no-shadow': 'off',
6780
'prefer-destructuring': 'off', // Intentionally disabled trash.
6881

69-
// prettier things
70-
'prettier/prettier': 'error',
71-
7282
'import/extensions': 'off',
7383
'import/prefer-default-export': 'off',
7484

package-lock.json

Lines changed: 0 additions & 130 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"eslint-config-airbnb-base": "^15.0.0",
1919
"eslint-config-prettier": "^9.1.0",
2020
"eslint-plugin-import": "^2.29.1",
21-
"eslint-plugin-prettier": "^5.1.3",
2221
"eslint-plugin-unicorn": "^50.0.1",
2322
"husky": "^9.1.4",
2423
"lint-staged": "^15.2.10",
@@ -34,7 +33,8 @@
3433
"test-staged": "npm run test-staged --workspaces --if-present -- --",
3534
"test-missing-apis": "npm run test-missing-apis --workspaces --if-present",
3635
"test-lint": "npm run lint",
37-
"lint": "eslint --format=unix packages/*/src/**/*.ts packages/*/src/*.ts"
36+
"lint": "prettier --check . && eslint --format=unix .",
37+
"fixlint": "prettier --write . && eslint --fix --format=unix ."
3838
},
3939
"husky": {
4040
"hooks": {
@@ -43,7 +43,7 @@
4343
},
4444
"lint-staged": {
4545
"*.{ts,js}": [
46-
"eslint --fix",
46+
"npm run fixlint",
4747
"npm run test-staged"
4848
]
4949
},

0 commit comments

Comments
 (0)