diff --git a/.eslintrc.json b/.eslintrc.json index 016c53e5..39afd3e2 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -50,6 +50,8 @@ "project": "./tsconfig.eslint.json" }, "rules": { + "curly": [2, "multi-line"], + "@typescript-eslint/prefer-for-of": 0, "@typescript-eslint/member-ordering": 0, "@typescript-eslint/explicit-function-return-type": 0, diff --git a/package.json b/package.json index 307c43f9..b754e329 100644 --- a/package.json +++ b/package.json @@ -17,18 +17,17 @@ "./package.json": "./package.json", ".": { "import": { - "source": "./src/index.ts", "types": "./dist/esm/index.d.ts", "default": "./dist/esm/index.js" }, "require": { - "source": "./src/index.ts", "types": "./dist/commonjs/index.d.ts", "default": "./dist/commonjs/index.js" } } }, "main": "./dist/commonjs/index.js", + "module": "./dist/esm/index.js", "types": "./dist/commonjs/index.d.ts", "files": [ "lib/**/*" @@ -37,9 +36,10 @@ "format": "npm run format:es && npm run format:prettier", "format:es": "npm run lint:es -- --fix", "format:prettier": "npm run prettier -- --write", - "lint": "npm run lint:es && npm run lint:prettier", + "lint": "npm run lint:tsc && npm run lint:es && npm run lint:prettier", "lint:es": "eslint src", "lint:prettier": "npm run prettier -- --check", + "lint:tsc": "tsc --noEmit", "prepublishOnly": "tshy", "prettier": "prettier '**/*.{ts,md,json,yml}'", "test": "npm run test:vi && npm run lint", diff --git a/tsconfig.json b/tsconfig.json index e034ddcc..5212144a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,18 +2,20 @@ "compilerOptions": { /* Basic Options */ "target": "ES2019" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */, - "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */, + "module": "Node16" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */, // "lib": [], /* Specify library files to be included in the compilation. */ "declaration": true /* Generates corresponding '.d.ts' file. */, "declarationMap": true /* Generates a sourcemap for each corresponding '.d.ts' file. */, // "sourceMap": true, /* Generates corresponding '.map' file. */ - "outDir": "dist/commonjs" /* Redirect output structure to the directory. */, + "outDir": "dist/esm" /* Redirect output structure to the directory. */, // "importHelpers": true, /* Import emit helpers from 'tslib'. */ /* Strict Type-Checking Options */ "strict": true /* Enable all strict type-checking options. */, /* Additional Checks */ + "isolatedDeclarations": true, + "isolatedModules": true, "noUnusedLocals": true /* Report errors on unused locals. */, "noUnusedParameters": true /* Report errors on unused parameters. */, "noImplicitReturns": true /* Report error when not all code paths in function return a value. */,