File tree Expand file tree Collapse file tree 7 files changed +470
-35
lines changed Expand file tree Collapse file tree 7 files changed +470
-35
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "env" : {
3
+ "node" : true ,
4
+ "es2021" : true
5
+ },
6
+ "extends" : [
7
+ " eslint:recommended" ,
8
+ " plugin:@typescript-eslint/recommended"
9
+ ],
10
+ "parser" : " @typescript-eslint/parser" ,
11
+ "parserOptions" : {
12
+ "ecmaVersion" : " latest"
13
+ },
14
+ "plugins" : [
15
+ " @typescript-eslint"
16
+ ],
17
+ "rules" : {
18
+ "@typescript-eslint/no-explicit-any" : " off"
19
+ },
20
+ "overrides" : [
21
+ {
22
+ "files" : [
23
+ " *.spec.ts"
24
+ ],
25
+ "env" : {
26
+ "jest" : true
27
+ },
28
+ "rules" : {
29
+ "no-unused-vars" : " off" ,
30
+ "@typescript-eslint/no-unused-vars" : " off" ,
31
+ "import/no-extraneous-dependencies" : " off"
32
+ }
33
+ }
34
+ ],
35
+ "ignorePatterns" : [
36
+ " dist" ,
37
+ " node_modules" ,
38
+ " gen"
39
+ ]
40
+ }
Original file line number Diff line number Diff line change 24
24
- run : yarn test
25
25
env :
26
26
CI : true
27
+ eslint :
28
+ runs-on : ubuntu-latest
29
+ steps :
30
+ - uses : actions/checkout@v2
31
+ - name : Setup Node
32
+ uses : actions/setup-node@v2
33
+ with :
34
+ node-version : 17
35
+ - name : Cache Yarn
36
+ uses : actions/cache@v2
37
+ with :
38
+ path : ' **/node_modules'
39
+ key : ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
40
+ restore-keys : |
41
+ ${{ runner.os }}-yarn-
42
+ - run : yarn install --frozen-lockfile
43
+ - run : yarn lint-fix
44
+ - name : Auto commit fixed code
45
+ id : auto-commit-action
46
+ uses : stefanzweifel/git-auto-commit-action@v4
47
+ with :
48
+ commit_message : Apply auto lint-fix changes
49
+ branch : ${{ github.head_ref }}
50
+ - name : eslint
51
+ if : steps.auto-commit-action.outputs.changes_detected == 'false'
52
+ uses : reviewdog/action-eslint@v1
53
+ with :
54
+ level : warning
55
+ reporter : github-pr-review
Original file line number Diff line number Diff line change 23
23
"build" : " run-p build:*" ,
24
24
"build:main" : " tsc -p tsconfig.main.json" ,
25
25
"build:module" : " tsc -p tsconfig.module.json" ,
26
+ "lint" : " eslint --ext .ts ." ,
27
+ "lint-fix" : " eslint --fix --ext .ts ." ,
26
28
"generate" : " run-p build:* && graphql-codegen" ,
27
29
"prepublish" : " run-p build:*"
28
30
},
47
49
"@graphql-codegen/typescript" : " ^2.4.2" ,
48
50
"@tsconfig/recommended" : " ^1.0.1" ,
49
51
"@types/jest" : " ^27.4.0" ,
52
+ "@typescript-eslint/eslint-plugin" : " ^5.10.0" ,
53
+ "@typescript-eslint/parser" : " ^5.10.0" ,
54
+ "eslint" : " ^8.7.0" ,
50
55
"jest" : " ^27.4.7" ,
51
56
"npm-run-all" : " ^4.1.5" ,
52
57
"ts-jest" : " ^27.1.3" ,
Original file line number Diff line number Diff line change @@ -115,23 +115,3 @@ export interface ValidationSchemaPluginConfig extends TypeScriptPluginConfig {
115
115
*/
116
116
directives ?: DirectiveConfig ;
117
117
}
118
-
119
- interface YupSchemaPluginConfig {
120
- /**
121
- * @description Generates yup schema as strict.
122
- * @default false
123
- * @see https://github.com/jquense/yup#schemastrictenabled-boolean--false-schema
124
- *
125
- * @exampleMarkdown
126
- * ```yml
127
- * generates:
128
- * path/to/file.ts:
129
- * plugins:
130
- * - graphql-codegen-validation-schema
131
- * config:
132
- * yup:
133
- * strict: true
134
- * ```
135
- */
136
- strict ?: boolean ;
137
- }
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ export const plugin: PluginFunction<
23
23
leave : visitor ,
24
24
} ) ;
25
25
26
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
26
27
// @ts -ignore
27
28
const generated = result . definitions . filter ( ( def ) => typeof def === "string" ) ;
28
29
Original file line number Diff line number Diff line change @@ -14,7 +14,9 @@ describe("isConvertableRegexp", () => {
14
14
"/hello/y" ,
15
15
"/hello/dgimsuy" ,
16
16
`/\\w+\\s/g` ,
17
+ // eslint-disable-next-line no-useless-escape
17
18
`/^[a-z]+:[\\\/]$/i` ,
19
+ // eslint-disable-next-line no-useless-escape
18
20
`/^(?:\d{3}|\(\d{3}\))([-\/\.])\d{3}\\1\d{4}$/` ,
19
21
] ) ( "%s" , ( maybeRegexp ) => {
20
22
expect ( isConvertableRegexp ( maybeRegexp ) ) . toBeTruthy ( ) ;
You can’t perform that action at this time.
0 commit comments