File tree 7 files changed +36
-27
lines changed
7 files changed +36
-27
lines changed Original file line number Diff line number Diff line change
1
+
2
+ name : Node.js CI
3
+
4
+ on :
5
+ push :
6
+ branches :
7
+ - main
8
+ pull_request :
9
+
10
+ jobs :
11
+ nodejs :
12
+ # Documentation: https://github.com/zakodium/workflows#nodejs-ci
13
+ uses : zakodium/workflows/.github/workflows/nodejs.yml@nodejs-v1
Original file line number Diff line number Diff line change 1
1
{
2
- "dep" : " prod,dev"
2
+ "dep" : " prod,dev" ,
3
+ "reject" : [" eslint" ]
3
4
}
Original file line number Diff line number Diff line change
1
+ CHANGELOG.md
Original file line number Diff line number Diff line change
1
+ import react from './index.js' ;
2
+
3
+ export default [ ...react ] ;
Original file line number Diff line number Diff line change 1
1
import cheminfoBase from 'eslint-config-cheminfo/base' ;
2
+
2
3
import react from './base.js' ;
3
4
4
5
export default [ ...cheminfoBase , ...react ] ;
Original file line number Diff line number Diff line change 13
13
" noRestrictedGlobals.js"
14
14
],
15
15
"scripts" : {
16
- "test" : " node test/test.js"
16
+ "eslint" : " eslint *.js test/test.js" ,
17
+ "eslint-fix" : " npm run eslint -- --fix" ,
18
+ "prettier" : " prettier --check ." ,
19
+ "prettier-write" : " prettier --write ." ,
20
+ "test" : " npm run test-only && npm run eslint && npm run prettier" ,
21
+ "test-only" : " node test/test.js"
17
22
},
18
23
"repository" : {
19
24
"type" : " git" ,
27
32
},
28
33
"homepage" : " https://github.com/cheminfo/eslint-config-cheminfo-react#readme" ,
29
34
"dependencies" : {
30
- "eslint-config-cheminfo" : " ^11.0.2 " ,
31
- "eslint-plugin-react" : " ^7.34.3 " ,
35
+ "eslint-config-cheminfo" : " ^11.0.4 " ,
36
+ "eslint-plugin-react" : " ^7.35.0 " ,
32
37
"eslint-plugin-react-hooks" : " ^4.6.2" ,
33
- "eslint-plugin-react-refresh" : " ^0.4.7 " ,
38
+ "eslint-plugin-react-refresh" : " ^0.4.8 " ,
34
39
"globals" : " ^15.8.0"
35
40
},
36
41
"peerDependencies" : {
37
42
"eslint" : " ^8.57.0"
38
43
},
39
44
"devDependencies" : {
40
45
"eslint" : " 8.57.0" ,
41
- "prettier" : " ^3.3.2 " ,
46
+ "prettier" : " ^3.3.3 " ,
42
47
"react" : " ^18.3.1"
43
48
}
44
49
}
Original file line number Diff line number Diff line change 1
1
import assert from 'node:assert' ;
2
- import fs from 'node:fs' ;
3
- import util from 'node:util' ;
4
2
5
- import { Linter } from 'eslint' ;
3
+ import { loadESLint } from 'eslint' ;
6
4
7
- import config from '../index.js' ;
5
+ const ESLint = await loadESLint ( { useFlatConfig : true } ) ;
6
+ /** @type {import('eslint').ESLint } */
7
+ const eslint = new ESLint ( ) ;
8
8
9
- const linter = new Linter ( { configType : 'flat' } ) ;
9
+ const [ okResult ] = await eslint . lintFiles ( [ 'test/ok.jsx' ] ) ;
10
10
11
- function readTestFile ( filename ) {
12
- return fs . readFileSync ( new URL ( `./${ filename } ` , import . meta. url ) , 'utf8' ) ;
13
- }
14
-
15
- function verifyTestFile ( filename ) {
16
- return linter . verify ( readTestFile ( filename ) , config , {
17
- filename : `test/${ filename } ` ,
18
- } ) ;
19
- }
20
-
21
- const okResult = verifyTestFile ( 'ok.jsx' ) ;
22
- assert . strictEqual (
23
- okResult . length ,
24
- 0 ,
25
- `ok.jsx should have no error: ${ util . inspect ( okResult ) } ` ,
26
- ) ;
11
+ assert . strictEqual ( okResult . errorCount , 0 , 'ok.jsx should have no error' ) ;
You can’t perform that action at this time.
0 commit comments