File tree 4 files changed +26
-24
lines changed
4 files changed +26
-24
lines changed Original file line number Diff line number Diff line change @@ -10,12 +10,11 @@ jobs:
10
10
fail-fast : false
11
11
matrix :
12
12
node-version :
13
- - 16
14
- - 14
15
- - 12
13
+ - 20
14
+ - 18
16
15
steps :
17
- - uses : actions/checkout@v2
18
- - uses : actions/setup-node@v2
16
+ - uses : actions/checkout@v4
17
+ - uses : actions/setup-node@v4
19
18
with :
20
19
node-version : ${{ matrix.node-version }}
21
20
- run : npm install
Original file line number Diff line number Diff line change 1
- 'use strict' ;
2
-
3
- module . exports = {
1
+ const config = {
4
2
extends : 'stylelint-config-xo' ,
5
3
rules : {
6
4
indentation : [
7
5
2 ,
8
6
{
9
- baseIndentLevel : 1
10
- }
11
- ]
12
- }
7
+ baseIndentLevel : 1 ,
8
+ } ,
9
+ ] ,
10
+ } ,
13
11
} ;
12
+
13
+ export default config ;
Original file line number Diff line number Diff line change 10
10
"email" : " sindresorhus@gmail.com" ,
11
11
"url" : " https://sindresorhus.com"
12
12
},
13
+ "type" : " module" ,
14
+ "exports" : " ./index.js" ,
15
+ "sideEffects" : false ,
13
16
"engines" : {
14
- "node" : " >=12 "
17
+ "node" : " >=18 "
15
18
},
16
19
"scripts" : {
17
20
"test" : " xo && ava"
46
49
" simple"
47
50
],
48
51
"dependencies" : {
49
- "stylelint-config-xo" : " ^0.21 .0"
52
+ "stylelint-config-xo" : " ^1.0 .0"
50
53
},
51
54
"devDependencies" : {
52
- "ava" : " ^2.4.0 " ,
53
- "stylelint" : " ^14.5.3 " ,
54
- "xo" : " ^0.33.1 "
55
+ "ava" : " ^6.1.2 " ,
56
+ "stylelint" : " ^16.4.0 " ,
57
+ "xo" : " ^0.58.0 "
55
58
},
56
59
"peerDependencies" : {
57
- "stylelint" : " >=14 "
60
+ "stylelint" : " >=16 "
58
61
}
59
62
}
Original file line number Diff line number Diff line change 1
1
import test from 'ava' ;
2
2
import stylelint from 'stylelint' ;
3
- import config from '..' ;
3
+ import config from '../index.js ' ;
4
4
5
5
const hasRule = ( errors , ruleId ) => errors . some ( x => x . rule === ruleId ) ;
6
6
7
7
const runStylelint = async code => {
8
8
const { results} = await stylelint . lint ( {
9
9
code,
10
- config
10
+ config,
11
11
} ) ;
12
12
13
13
for ( const result of results ) {
14
- if ( result . deprecations . length !== 0 ) {
14
+ if ( result . deprecations . length > 0 ) {
15
15
throw new Error ( `Deprecations:\n${ result . deprecations . join ( '\n' ) } ` ) ;
16
16
}
17
17
18
- if ( result . invalidOptionWarnings . length !== 0 ) {
18
+ if ( result . invalidOptionWarnings . length > 0 ) {
19
19
const warnings = result . invalidOptionWarnings . map ( x => x . text ) . join ( '\n' ) ;
20
20
throw new Error ( `Invalid options:\n${ warnings } ` ) ;
21
21
}
@@ -29,8 +29,8 @@ test('main', async t => {
29
29
`div {
30
30
left: .2em;
31
31
}
32
- `
32
+ ` ,
33
33
) ;
34
34
35
- t . true ( hasRule ( results [ 0 ] . warnings , 'number-leading-zero' ) ) ;
35
+ t . true ( hasRule ( results [ 0 ] . warnings , '@stylistic/ number-leading-zero' ) ) ;
36
36
} ) ;
You can’t perform that action at this time.
0 commit comments