Skip to content

Commit 1194923

Browse files
authored
Use swc/jest (#992)
* refactor converter * rename to B2o5T * improve ruletester * refactor
1 parent 3496388 commit 1194923

File tree

81 files changed

+1727
-2352
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+1727
-2352
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ module.exports = {
3636
'eslint-plugin/require-meta-docs-description': ['error', { pattern: '.+\\.$' }], // force to put a point at the end
3737
'eslint-plugin/require-meta-docs-url': [
3838
'error',
39-
{ pattern: 'https://github.com/dotansimha/graphql-eslint/blob/master/docs/rules/{{name}}.md' },
39+
{ pattern: 'https://github.com/B2o5T/graphql-eslint/blob/master/docs/rules/{{name}}.md' },
4040
],
4141
},
4242
},

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This project integrates GraphQL and ESLint, for a better developer experience.
44

55
[![npm version](https://badge.fury.io/js/%40graphql-eslint%2Feslint-plugin.svg)](https://badge.fury.io/js/%40graphql-eslint%2Feslint-plugin)
66

7-
> Created and maintained by [The Guild](http://the-guild.dev)
7+
> Created and maintained by [The Guild](https://the-guild.dev)
88
99
## Key Features
1010

@@ -92,7 +92,7 @@ Under the hood, specifying the `@graphql-eslint/graphql` processor for code file
9292

9393
### Extended linting rules with GraphQL Schema
9494

95-
Some rules require an understanding of the entire schema at once. For example, [no-unreachable-types](https://github.com/dotansimha/graphql-eslint/blob/master/docs/rules/no-unreachable-types.md#no-unreachable-types) checks that all types are reachable by root-level fields.
95+
Some rules require an understanding of the entire schema at once. For example, [no-unreachable-types](https://github.com/B2o5T/graphql-eslint/blob/master/docs/rules/no-unreachable-types.md#no-unreachable-types) checks that all types are reachable by root-level fields.
9696

9797
To use these rules, you'll need to tell ESLint how to identify the entire set of schema definitions.
9898

docs/custom-rules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export const rule = {
118118
}
119119
```
120120

121-
The structure of the return value of `.typeInfo()` is [defined here](https://github.com/dotansimha/graphql-eslint/blob/master/packages/plugin/src/estree-parser/converter.ts#L45-L53). So based on the `node` you are using, you'll get a different values on `.typeInfo()` result.
121+
The structure of the return value of `.typeInfo()` is [defined here](https://github.com/B2o5T/graphql-eslint/blob/master/packages/plugin/src/estree-parser/converter.ts#L63-L71). So based on the `node` you are using, you'll get a different values on `.typeInfo()` result.
122122

123123
## Testing your rules
124124

examples/basic/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@graphql-eslint/example-basic",
33
"private": true,
44
"version": "0.0.1",
5-
"repository": "https://github.com/dotansimha/graphql-eslint",
5+
"repository": "https://github.com/B2o5T/graphql-eslint",
66
"author": "Dotan Simha <[email protected]>",
77
"license": "MIT",
88
"scripts": {

examples/code-file/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@graphql-eslint/example-code-file",
33
"private": true,
44
"version": "0.0.1",
5-
"repository": "https://github.com/dotansimha/graphql-eslint",
5+
"repository": "https://github.com/B2o5T/graphql-eslint",
66
"author": "Dotan Simha <[email protected]>",
77
"license": "MIT",
88
"scripts": {

examples/graphql-config-code-file/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@graphql-eslint/example-graphql-config-code-file",
33
"private": true,
44
"version": "0.0.1",
5-
"repository": "https://github.com/dotansimha/graphql-eslint",
5+
"repository": "https://github.com/B2o5T/graphql-eslint",
66
"author": "Dotan Simha <[email protected]>",
77
"license": "MIT",
88
"scripts": {

examples/graphql-config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@graphql-eslint/example-graphql-config",
33
"private": true,
44
"version": "0.0.1",
5-
"repository": "https://github.com/dotansimha/graphql-eslint",
5+
"repository": "https://github.com/B2o5T/graphql-eslint",
66
"author": "Dotan Simha <[email protected]>",
77
"license": "MIT",
88
"scripts": {

examples/prettier/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@graphql-eslint/example-prettier",
33
"private": true,
44
"version": "0.0.1",
5-
"repository": "https://github.com/dotansimha/graphql-eslint",
5+
"repository": "https://github.com/B2o5T/graphql-eslint",
66
"author": "JounQin <[email protected]>",
77
"license": "MIT",
88
"scripts": {

jest.config.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
1-
const { pathsToModuleNameMapper } = require('ts-jest');
2-
const { compilerOptions } = require('./tsconfig.json');
3-
41
module.exports = {
5-
testEnvironment: 'node',
62
modulePathIgnorePatterns: ['/dist/'],
7-
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
8-
moduleNameMapper: {
9-
...pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>/' }),
10-
'@eslint/eslintrc/universal': '@eslint/eslintrc/dist/eslintrc-universal.cjs',
3+
transform: {
4+
'^.+\\.(t|j)sx?$': '@swc/jest',
115
},
126
snapshotSerializers: ['jest-snapshot-serializer-raw/always'],
137
snapshotResolver: './snapshot-resolver.js',

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"private": true,
3-
"repository": "https://github.com/dotansimha/graphql-eslint",
3+
"repository": "https://github.com/B2o5T/graphql-eslint",
44
"author": "Dotan Simha <[email protected]>",
55
"license": "MIT",
66
"workspaces": [
@@ -27,8 +27,10 @@
2727
"@babel/preset-env": "7.16.11",
2828
"@babel/preset-typescript": "7.16.7",
2929
"@changesets/cli": "2.20.0",
30+
"@swc/core": "1.2.155",
31+
"@swc/jest": "0.2.20",
3032
"@types/dedent": "0.7.0",
31-
"@types/jest": "27.4.0",
33+
"@types/jest": "27.4.1",
3234
"@types/node": "16.11.24",
3335
"@typescript-eslint/eslint-plugin": "5.11.0",
3436
"@typescript-eslint/parser": "5.11.0",
@@ -51,7 +53,6 @@
5153
"patch-package": "6.4.7",
5254
"prettier": "2.5.1",
5355
"rimraf": "3.0.2",
54-
"ts-jest": "27.1.3",
5556
"ts-node": "10.5.0",
5657
"typescript": "4.5.5"
5758
},

0 commit comments

Comments
 (0)