Skip to content

Commit 35c82a0

Browse files
committed
chore(deps): update eslint and related tooling
Upgrade ESLint and related dependencies to latest major versions, including @typescript-eslint, prettier, and esbuild. Replace legacy .eslintrc.js config with new flat config (eslint.config.mjs). Update Node.js engine to 18+ and add .node-version file. Adjust esbuild config to use Node 18 and output path from package.json. Remove obsolete files and update package-lock.json to reflect new dependency tree.
1 parent 9868a04 commit 35c82a0

File tree

13 files changed

+2732
-2885
lines changed

13 files changed

+2732
-2885
lines changed

.eslintignore

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

.eslintrc.js

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

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
18

esbuild.mjs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
import fs from 'fs';
12
import * as esbuild from 'esbuild';
23

4+
const loadJSON = (path) => JSON.parse(fs.readFileSync(new URL(path, import.meta.url)));
5+
const data = loadJSON('package.json');
6+
37
const options = {
48
entryPoints: ['src/index.ts'],
59
bundle: true,
@@ -8,8 +12,8 @@ const options = {
812
mainFields: ['module', 'main'],
913
external: ['coc.nvim'],
1014
platform: 'node',
11-
target: 'node16',
12-
outfile: 'lib/index.js',
15+
target: 'node18',
16+
outfile: data.main,
1317
// https://esbuild.github.io/api/#log-level
1418
logLevel: process.env.NODE_ENV === 'development' ? 'info' : 'error',
1519
};

eslint.config.mjs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import tseslint from '@typescript-eslint/eslint-plugin';
2+
import tsparser from '@typescript-eslint/parser';
3+
import prettierPlugin from 'eslint-plugin-prettier';
4+
import prettierConfig from 'eslint-config-prettier';
5+
6+
export default [
7+
{
8+
files: ['src/**/*.ts'],
9+
10+
languageOptions: {
11+
parser: tsparser,
12+
sourceType: 'module',
13+
},
14+
15+
plugins: {
16+
'@typescript-eslint': tseslint,
17+
prettier: prettierPlugin,
18+
},
19+
20+
rules: {
21+
...tseslint.configs.recommended.rules,
22+
...prettierConfig.rules,
23+
'@typescript-eslint/no-unused-vars': 'warn',
24+
'no-console': 'warn',
25+
semi: ['error', 'always'],
26+
'prettier/prettier': 'error',
27+
},
28+
},
29+
];

0 commit comments

Comments
 (0)