Skip to content

Commit a454ec2

Browse files
committed
fix the eslint config and script
1 parent 910c937 commit a454ec2

File tree

5 files changed

+55
-184
lines changed

5 files changed

+55
-184
lines changed

.eslintignore

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

.eslintrc

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

eslint.config.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import js from '@eslint/js';
2+
import globals from 'globals';
3+
import tseslint from 'typescript-eslint';
4+
import eslintConfigPrettier from 'eslint-config-prettier';
5+
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
6+
import { defineConfig } from 'eslint/config';
7+
8+
export default defineConfig([
9+
{
10+
files: ['**/*.{js,mjs,cjs,ts,mts,cts}'],
11+
plugins: { js },
12+
extends: ['js/recommended'],
13+
languageOptions: { globals: { ...globals.browser, ...globals.node } },
14+
},
15+
tseslint.configs.recommended,
16+
eslintConfigPrettier,
17+
eslintPluginPrettierRecommended,
18+
]);

package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@
2323
"scripts": {
2424
"test": "npm run lint && npm run check && npm run testonly",
2525
"test:ci": "npm run lint && npm run check && npm run testonly -- --coverage",
26-
"lint": "eslint .",
27-
"check": "flow check --max-warnings 0",
28-
"build": "babel src --ignore src/__tests__ --out-dir dist/ ; cp src/index.js dist/index.js.flow ; cp src/index.d.ts dist/",
29-
"watch": "babel resources/watch.js | node",
30-
"testonly": "jest src",
26+
"lint": "eslint ./src --ext .js,.ts",
3127
"check": "tsc --noEmit --pretty",
3228
"build": "tsup",
3329
"watch": "tsup --watch",

tsconfig.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
// Visit https://aka.ms/tsconfig to read more about this file
3+
"compilerOptions": {
4+
// Environment Settings
5+
// See also https://aka.ms/tsconfig/module
6+
"module": "nodenext",
7+
"target": "esnext",
8+
"types": ["node"],
9+
10+
// Other Outputs
11+
"sourceMap": true,
12+
"declaration": true,
13+
"declarationMap": true,
14+
15+
// Stricter Typechecking Options
16+
"noUncheckedIndexedAccess": true,
17+
"exactOptionalPropertyTypes": true,
18+
19+
// Style Options
20+
"noImplicitReturns": true,
21+
"noImplicitOverride": true,
22+
"noUnusedLocals": true,
23+
"noUnusedParameters": true,
24+
"noFallthroughCasesInSwitch": true,
25+
"noPropertyAccessFromIndexSignature": true,
26+
27+
// Recommended Options
28+
"strict": true,
29+
// "verbatimModuleSyntax": true,
30+
"isolatedModules": true,
31+
"noUncheckedSideEffectImports": true,
32+
"moduleDetection": "force",
33+
"skipLibCheck": true,
34+
"allowImportingTsExtensions": true
35+
}
36+
}

0 commit comments

Comments
 (0)