Skip to content

Commit

Permalink
chore: unify jest.config.ts and .eslintrc.json (#881)
Browse files Browse the repository at this point in the history
  • Loading branch information
ymc9 authored Dec 3, 2023
1 parent bb149bd commit aa705a4
Show file tree
Hide file tree
Showing 32 changed files with 367 additions and 3,704 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/dist/**
3 changes: 1 addition & 2 deletions packages/schema/.eslintrc.json → .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@
"rules": {
"jest/expect-expect": "off",
"@typescript-eslint/no-unused-vars": ["error", { "varsIgnorePattern": "^_", "argsIgnorePattern": "^_" }]
},
"ignorePatterns": ["src/language-server/generated/*"]
}
}
29 changes: 29 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* For a detailed explanation regarding each configuration property and type check, visit:
* https://jestjs.io/docs/configuration
*/

export default {
// Automatically clear mock calls, instances, contexts and results before every test
clearMocks: true,

// Indicates whether the coverage information should be collected while executing the test
collectCoverage: true,

// The directory where Jest should output its coverage files
coverageDirectory: 'tests/coverage',

// An array of regexp pattern strings used to skip coverage collection
coveragePathIgnorePatterns: ['/node_modules/', '/tests/'],

// Indicates which provider should be used to instrument code for coverage
coverageProvider: 'v8',

// A list of reporter names that Jest uses when writing coverage reports
coverageReporters: ['json', 'text', 'lcov', 'clover'],

// A map from regular expressions to paths to transformers
transform: { '^.+\\.tsx?$': 'ts-jest' },

testTimeout: 300000,
};
16 changes: 14 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"description": "",
"scripts": {
"build": "pnpm -r build",
"lint": "pnpm -r lint",
"test": "ZENSTACK_TEST=1 pnpm -r run test --silent --forceExit",
"test-ci": "ZENSTACK_TEST=1 pnpm -r run test --silent --forceExit",
"lint": "pnpm -r lint",
"publish-all": "pnpm --filter \"./packages/**\" -r publish --access public",
"publish-preview": "pnpm --filter \"./packages/**\" -r publish --force --registry https://preview.registry.zenstack.dev/",
"unpublish-preview": "pnpm --recursive --shell-mode exec -- npm unpublish -f --registry https://preview.registry.zenstack.dev/ \"\\$PNPM_PACKAGE_NAME\""
Expand All @@ -16,8 +16,20 @@
"license": "MIT",
"devDependencies": {
"@changesets/cli": "^2.26.0",
"@types/jest": "^29.5.10",
"@types/node": "^20.10.2",
"@typescript-eslint/eslint-plugin": "^6.13.1",
"@typescript-eslint/parser": "^6.13.1",
"concurrently": "^7.4.0",
"copyfiles": "^2.4.1",
"eslint": "^8.55.0",
"eslint-plugin-jest": "^27.6.0",
"jest": "^29.7.0",
"replace-in-file": "^7.0.1",
"tsup": "^7.1.0"
"rimraf": "^3.0.2",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"tsup": "^8.0.1",
"typescript": "^5.3.2"
}
}
13 changes: 1 addition & 12 deletions packages/language/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"ignorePatterns": "src/generated/*",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
]
"extends": ["../../.eslintrc.json"]
}
6 changes: 1 addition & 5 deletions packages/language/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@
"author": "ZenStack Team",
"license": "MIT",
"devDependencies": {
"concurrently": "^7.4.0",
"copyfiles": "^2.4.1",
"langium-cli": "1.2.0",
"rimraf": "^3.0.2",
"typescript": "^4.9.4"
"langium-cli": "1.2.0"
},
"dependencies": {
"langium": "1.2.0"
Expand Down
14 changes: 0 additions & 14 deletions packages/plugins/openapi/.eslintrc.json

This file was deleted.

29 changes: 0 additions & 29 deletions packages/plugins/openapi/jest.config.ts

This file was deleted.

1 change: 1 addition & 0 deletions packages/plugins/openapi/jest.config.ts
10 changes: 0 additions & 10 deletions packages/plugins/openapi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,11 @@
},
"devDependencies": {
"@readme/openapi-parser": "^2.4.0",
"@types/jest": "^29.5.0",
"@types/node": "^18.0.0",
"@types/pluralize": "^0.0.29",
"@types/tmp": "^0.2.3",
"@typescript-eslint/eslint-plugin": "^5.54.0",
"@typescript-eslint/parser": "^5.54.0",
"@zenstackhq/testtools": "workspace:*",
"copyfiles": "^2.4.1",
"eslint": "^8.35.0",
"jest": "^29.5.0",
"pluralize": "^8.0.0",
"rimraf": "^3.0.2",
"tmp": "^0.2.1",
"ts-jest": "^29.0.5",
"typescript": "^4.9.5",
"zenstack": "workspace:*"
}
}
14 changes: 0 additions & 14 deletions packages/plugins/swr/.eslintrc.json

This file was deleted.

29 changes: 0 additions & 29 deletions packages/plugins/swr/jest.config.ts

This file was deleted.

1 change: 1 addition & 0 deletions packages/plugins/swr/jest.config.ts
9 changes: 1 addition & 8 deletions packages/plugins/swr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,12 @@
"devDependencies": {
"@tanstack/react-query": "^4.28.0",
"@testing-library/react": "^14.0.0",
"@types/jest": "^29.5.0",
"@types/node": "^18.0.0",
"@types/react": "18.2.0",
"@types/semver": "^7.3.13",
"@types/tmp": "^0.2.3",
"@zenstackhq/testtools": "workspace:*",
"copyfiles": "^2.4.1",
"jest": "^29.5.0",
"nock": "^13.3.6",
"react": "18.2.0",
"rimraf": "^3.0.2",
"swr": "^2.2.4",
"ts-jest": "^29.0.5",
"typescript": "^4.9.4"
"swr": "^2.2.4"
}
}
14 changes: 0 additions & 14 deletions packages/plugins/tanstack-query/.eslintrc.json

This file was deleted.

29 changes: 0 additions & 29 deletions packages/plugins/tanstack-query/jest.config.ts

This file was deleted.

1 change: 1 addition & 0 deletions packages/plugins/tanstack-query/jest.config.ts
8 changes: 0 additions & 8 deletions packages/plugins/tanstack-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,26 +99,18 @@
"@tanstack/svelte-query-v5": "npm:@tanstack/svelte-query@^5.0.0",
"@tanstack/vue-query": "^4.37.0",
"@testing-library/react": "^14.0.0",
"@types/jest": "^29.5.0",
"@types/nock": "^11.1.0",
"@types/node": "^18.0.0",
"@types/react": "18.2.0",
"@types/semver": "^7.3.13",
"@types/tmp": "^0.2.3",
"@zenstackhq/testtools": "workspace:*",
"copyfiles": "^2.4.1",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"nock": "^13.3.6",
"react": "18.2.0",
"react-test-renderer": "^18.2.0",
"replace-in-file": "^7.0.1",
"rimraf": "^3.0.2",
"svelte": "^4.2.1",
"swr": "^2.0.3",
"ts-jest": "^29.0.5",
"tsup": "^8.0.0",
"typescript": "^4.9.4",
"vue": "^3.3.4"
}
}
14 changes: 0 additions & 14 deletions packages/plugins/trpc/.eslintrc.json

This file was deleted.

29 changes: 0 additions & 29 deletions packages/plugins/trpc/jest.config.ts

This file was deleted.

1 change: 1 addition & 0 deletions packages/plugins/trpc/jest.config.ts
9 changes: 1 addition & 8 deletions packages/plugins/trpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,8 @@
"@trpc/next": "^10.32.0",
"@trpc/react-query": "^10.32.0",
"@trpc/server": "^10.32.0",
"@types/jest": "^29.5.0",
"@types/node": "^18.0.0",
"@types/prettier": "^2.7.2",
"@zenstackhq/testtools": "workspace:*",
"copyfiles": "^2.4.1",
"jest": "^29.5.0",
"next": "^13.4.7",
"rimraf": "^3.0.2",
"ts-jest": "^29.0.5",
"typescript": "^4.9.4"
"next": "^13.4.7"
}
}
14 changes: 0 additions & 14 deletions packages/runtime/.eslintrc.json

This file was deleted.

Loading

0 comments on commit aa705a4

Please sign in to comment.