Skip to content

Commit e0f90cc

Browse files
authored
Merge #447 drop "eslint-plugin-prettier", invoke prettier explicitly
2 parents 366d6a7 + f67e2ab commit e0f90cc

File tree

11 files changed

+37
-157
lines changed

11 files changed

+37
-157
lines changed

.eslintrc.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
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+
reportUnusedDisableDirectives: true,
14+
ignorePatterns: [
15+
'.eslintrc.js',
16+
'packages/*/lib/',
17+
'packages/*/bin/',
18+
'packages/neovim/scripts/',
19+
'packages/integration-tests/__tests__/',
20+
'examples/rplugin/node/',
21+
'packages/example-plugin/',
22+
'packages/example-plugin-decorators/',
23+
],
1024
env: {
1125
node: true,
1226
es2024: true,
@@ -66,9 +80,6 @@ module.exports = {
6680
'no-shadow': 'off',
6781
'prefer-destructuring': 'off', // Intentionally disabled trash.
6882

69-
// prettier things
70-
'prettier/prettier': 'error',
71-
7283
'import/extensions': 'off',
7384
'import/prefer-default-export': 'off',
7485

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# some tests seem to create these files in CI
2+
nvim-win64

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
},

packages/decorators/src/plugin/plugin.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,13 @@ function wrapper(cls: PluginWrapperConstructor, options?: PluginOptions): any {
9696
}
9797

9898
// Can decorate a class with options object
99-
// eslint-disable-next-line import/export
99+
100100
export function Plugin(
101101
outter: any
102102
): (cls: PluginWrapperConstructor, options?: PluginOptions) => any;
103103

104-
// eslint-disable-next-line import/export
105104
export function Plugin(outter: any): any;
106105

107-
// eslint-disable-next-line import/export
108106
export function Plugin(outter: any): any {
109107
/**
110108
* Decorator should support

packages/neovim/src/api/Neovim.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@ import { ApiInfo } from '../types/ApiInfo';
99
export interface UiAttachOptions {
1010
rgb?: boolean;
1111
override?: boolean;
12-
// eslint-disable-next-line camelcase
12+
1313
ext_cmdline?: boolean;
14-
// eslint-disable-next-line camelcase
14+
1515
ext_hlstate?: boolean;
16-
// eslint-disable-next-line camelcase
16+
1717
ext_linegrid?: boolean;
18-
// eslint-disable-next-line camelcase
18+
1919
ext_messages?: boolean;
20-
// eslint-disable-next-line camelcase
20+
2121
ext_multigrid?: boolean;
22-
// eslint-disable-next-line camelcase
22+
2323
ext_popupmenu?: boolean;
24-
// eslint-disable-next-line camelcase
24+
2525
ext_tabline?: boolean;
26-
// eslint-disable-next-line camelcase
26+
2727
ext_wildmenu?: boolean;
28-
// eslint-disable-next-line camelcase
28+
2929
ext_termcolors?: boolean;
3030
}
3131

@@ -56,7 +56,7 @@ export interface Command {
5656
nargs: string;
5757
range: string;
5858
name: string;
59-
// eslint-disable-next-line camelcase
59+
6060
script_id: number;
6161
bar: boolean;
6262
register: boolean;
@@ -65,7 +65,7 @@ export interface Command {
6565
complete?: null;
6666
addr?: any;
6767
count?: any;
68-
// eslint-disable-next-line camelcase
68+
6969
complete_arg?: any;
7070
}
7171

packages/neovim/src/api/utils/createChainableApi.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ export function createChainableApi(
8181
},
8282

8383
set: (target: any, prop: string, value: any, receiver: Promise<any>) => {
84-
// eslint-disable-next-line no-param-reassign
8584
if (receiver && (receiver instanceof Promise || 'then' in receiver)) {
8685
receiver.then(obj => {
8786
if (prop in obj) {

packages/neovim/src/host/NvimPlugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export interface NvimPluginOptions {
99

1010
export interface AutocmdOptions {
1111
pattern?: string;
12-
// eslint-disable-next-line no-eval
12+
1313
eval?: string;
1414
sync?: boolean;
1515
}
@@ -24,7 +24,7 @@ export interface CommandOptions {
2424
export interface NvimFunctionOptions {
2525
sync?: boolean;
2626
range?: string;
27-
// eslint-disable-next-line no-eval
27+
2828
eval?: string;
2929
}
3030

packages/neovim/src/plugin/autocmd.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { NVIM_SYNC, NVIM_SPEC, NVIM_METHOD_NAME } from './properties';
22

33
export interface AutocmdOptions {
44
pattern: string;
5-
// eslint-disable-next-line no-eval
5+
66
eval?: string;
77
sync?: boolean;
88
}

0 commit comments

Comments
 (0)