File tree Expand file tree Collapse file tree 4 files changed +9
-13
lines changed Expand file tree Collapse file tree 4 files changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ export function shiftHeading(tree, shift) {
29
29
30
30
/** @type {VisitElement } */
31
31
function visitor ( node ) {
32
- var rank = headingRank ( node )
32
+ let rank = headingRank ( node )
33
33
34
34
if ( rank ) {
35
35
rank += shift
Original file line number Diff line number Diff line change 71
71
"trailingComma" : " none"
72
72
},
73
73
"xo" : {
74
- "prettier" : true ,
75
- "rules" : {
76
- "no-var" : " off" ,
77
- "prefer-arrow-callback" : " off"
78
- }
74
+ "prettier" : true
79
75
},
80
76
"remarkConfig" : {
81
77
"plugins" : [
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ npm install hast-util-shift-heading
27
27
import {h } from ' hastscript'
28
28
import {shiftHeading } from ' hast-util-shift-heading'
29
29
30
- var tree = h (' main' , [
30
+ const tree = h (' main' , [
31
31
h (' h1' , ' Alpha' ),
32
32
h (' p' , ' Bravo' ),
33
33
h (' h2' , ' Charlie' ),
Original file line number Diff line number Diff line change @@ -2,9 +2,9 @@ import test from 'tape'
2
2
import { h } from 'hastscript'
3
3
import { shiftHeading } from './index.js'
4
4
5
- test ( 'shiftHeading' , function ( t ) {
5
+ test ( 'shiftHeading' , ( t ) => {
6
6
t . throws (
7
- function ( ) {
7
+ ( ) => {
8
8
// @ts -ignore runtime.
9
9
shiftHeading ( h ( '' ) )
10
10
} ,
@@ -13,31 +13,31 @@ test('shiftHeading', function (t) {
13
13
)
14
14
15
15
t . throws (
16
- function ( ) {
16
+ ( ) => {
17
17
shiftHeading ( h ( '' ) , Number . NaN )
18
18
} ,
19
19
/ ^ E r r o r : E x p e c t e d a n o n - n u l l f i n i t e i n t e g e r , n o t ` N a N ` $ / ,
20
20
'should throw when given not a number'
21
21
)
22
22
23
23
t . throws (
24
- function ( ) {
24
+ ( ) => {
25
25
shiftHeading ( h ( '' ) , 0.1 )
26
26
} ,
27
27
/ ^ E r r o r : E x p e c t e d a n o n - n u l l f i n i t e i n t e g e r , n o t ` 0 .1 ` $ / ,
28
28
'should throw when not given an integer'
29
29
)
30
30
31
31
t . throws (
32
- function ( ) {
32
+ ( ) => {
33
33
shiftHeading ( h ( '' ) , Number . POSITIVE_INFINITY )
34
34
} ,
35
35
/ ^ E r r o r : E x p e c t e d a n o n - n u l l f i n i t e i n t e g e r , n o t ` I n f i n i t y ` $ / ,
36
36
'should throw when not given a finite number'
37
37
)
38
38
39
39
t . throws (
40
- function ( ) {
40
+ ( ) => {
41
41
shiftHeading ( h ( '' ) , 0 )
42
42
} ,
43
43
/ ^ E r r o r : E x p e c t e d a n o n - n u l l f i n i t e i n t e g e r , n o t ` 0 ` $ / ,
You can’t perform that action at this time.
0 commit comments