Skip to content

Commit 10bec9c

Browse files
committed
chore: add ts/js example
1 parent 92e4d88 commit 10bec9c

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

eslint.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { createRequire } from 'node:module'
44
const require = createRequire(import.meta.url)
55
require('sucrase/register')
66

7-
/** @type {typeof import('./src/index.ts')} */
87
const { defineConfig } = require('./src/index.ts')
98

109
// import { defineConfig } from './dist/index.js'

example/js.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
function test() {}
2+
test()
3+
;[1, 2, 3, 4, 5].forEach(item => {
4+
console.error(item, 'item')
5+
})

example/ts.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const str: string = 'test ts eslint'
2+
3+
function test(): string {
4+
return str
5+
}
6+
7+
test()
8+
;[1, 2, 3, 4, 5].forEach(item => {
9+
console.warn(item, 'item')
10+
})

src/configs/prettier.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ export async function prettier(rules: PartialPrettierExtendedOptions) {
2020
},
2121
rules: {
2222
...eslintRules,
23+
'prettier/prettier': ['warn', pRules],
24+
// eslint-disable-next-line perfectionist/sort-objects
2325
'arrow-body-style': 'off',
2426
'prefer-arrow-callback': 'off',
25-
'prettier/prettier': ['warn', pRules],
2627
},
2728
},
2829
]

0 commit comments

Comments
 (0)