Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[foundation] 升级 eslint, 同时 更新 7.0.3-> 7.0.6 解决 cross-spawn 的安全问题 #31

Merged
merged 3 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .nycrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "@istanbuljs/nyc-config-typescript",
"all": true,
"include": [
"src/**/*.ts"
],
"exclude": [
"**/*.d.ts"
]
}
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hongshancapital/power-guard",
"version": "4.1.2",
"version": "4.1.3",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"files": [
Expand All @@ -13,18 +13,19 @@
"scripts": {
"build": "rm -rf lib/ && tsc",
"lint": "eslint --ext .tsx --ext .ts src/ tests/",
"test": "nyc --reporter=html mocha -r ts-node/register tests/**/*.test.ts"
"test": "NODE_OPTIONS=\"--loader=ts-node/esm --no-warnings\" nyc --reporter=html mocha --require ts-node/register/transpile-only tests/**/*.test.ts"
},
"exports": {
".": "./lib/index.js"
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.2",
"@types/chai": "^4.3.0",
"@types/mocha": "^9.1.0",
"@typescript-eslint/eslint-plugin": "^7.7.0",
"@typescript-eslint/parser": "^7.7.0",
"@typescript-eslint/eslint-plugin": "^8.19.0",
"@typescript-eslint/parser": "^8.19.0",
"chai": "^4.5.0",
"eslint": "^8.37.0",
"eslint": "8.57.1",
"eslint-config-prettier": "^8.8.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.29.1",
Expand All @@ -35,11 +36,11 @@
"nyc": "^15.1.0",
"prettier": "^2.8.7",
"ts-node": "^10.9.1",
"typescript": "^4.9.5"
"typescript": "^4.9.5",
"semver": "^7.6.3"
},
"resolutions": {
"braces": "3.0.3",
"semver": "5.7.2"
"braces": "3.0.3"
},
"dependencies": {},
"volta": {
Expand Down
4 changes: 2 additions & 2 deletions tests/boolean.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { boolean, PowerGuardError } from '../src';
import guard from '../src/boolean/guard';
import { boolean, PowerGuardError } from '../src/index.js';
import guard from '../src/boolean/guard.js';
import { expect } from 'chai';

describe('Boolean guard', () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/enum.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { enumGuard, PowerGuardError } from '../src';
import { enumGuard, PowerGuardError } from '../src/index.js';
import { expect } from 'chai';

enum Foo {
Expand Down
6 changes: 3 additions & 3 deletions tests/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import guard, { number, string, enumGuard, boolean, array } from '../src';
import { guard, number, string, enumGuard, boolean, guardArray } from '../src/index.js';
import { expect } from 'chai';
import PowerGuardError, { PowerGuardKeyError } from '../src/error';
import PowerGuardError, { PowerGuardKeyError } from '../src/error.js';

enum Foo {
key1 = 'key1',
Expand All @@ -12,7 +12,7 @@ const guardFunc = guard({
bar: string.escaped.optional,
baz: enumGuard(Foo).optional.array,
bla: boolean.loose.optional,
bnd: array(guard({ foo: number.strict.required }), true),
bnd: guardArray(guard({ foo: number.strict.required }), true),
});

describe('Power guard', () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/number.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { number, PowerGuardError } from '../src';
import { number, PowerGuardError } from '../src/index.js';
import { expect } from 'chai';

describe('Number guard', () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/string.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { string, PowerGuardError } from '../src';
import { string, PowerGuardError } from '../src/index.js';
import { expect } from 'chai';

describe('String guard', () => {
Expand Down
9 changes: 7 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
{
"ts-node": {
"esm": true,
"experimentalSpecifier": true
},
"compilerOptions": {
"target": "es6",
"target": "es2020",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": false,
"skipLibCheck": false,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"moduleResolution": "node16",
"moduleResolution": "NodeNext",
"module": "NodeNext",
"resolveJsonModule": true,
"isolatedModules": true,
"declaration": true,
Expand Down
Loading