Skip to content

Commit 842bc2c

Browse files
committed
Update to ESLint v10
1 parent 7cd8600 commit 842bc2c

File tree

7 files changed

+1130
-1260
lines changed

7 files changed

+1130
-1260
lines changed

.eslintrc.json

Lines changed: 0 additions & 63 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Bootstrap a new TypeScript module in five minutes or less.
1616
- Use private packages from [GitHub Packages].
1717
- Publish as a private package to [GitHub Packages].
1818
- Examples with configurable options and arguments powered by [yargs] with [landlubber].
19-
- Linting with the [JavaScript Standard Style] using [ESLint].
19+
- Linting with [eslint-config-love] using [ESLint].
2020
- [Prettier] code.
2121
- Futuristic debuggable unit testing with [AVA].
2222
- Code coverage reporting with [Istanbul] and [c8].
@@ -38,7 +38,7 @@ Bootstrap a new TypeScript module in five minutes or less.
3838
[GitHub Codespaces]: https://github.com/features/packages
3939
[GitHub Packages]: https://github.com/features/packages
4040
[Istanbul]: https://istanbul.js.org/
41-
[JavaScript Standard Style]: https://standardjs.com/
41+
[eslint-config-love]: https://github.com/mightyiam/eslint-config-love
4242
[Node.js]: https://nodejs.org/
4343
[Prettier]: https://prettier.io/
4444
[semantic-release]: https://semantic-release.gitbook.io/

eslint.config.ts

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import { globalIgnores } from 'eslint/config'
2+
import love from 'eslint-config-love'
3+
import prettier from 'eslint-config-prettier/flat'
4+
import simpleImportSort from 'eslint-plugin-simple-import-sort'
5+
import unusedImports from 'eslint-plugin-unused-imports'
6+
7+
const files = ['**/*.{ts,tsx}']
8+
9+
export default [
10+
globalIgnores(['**/*.d.ts']),
11+
{
12+
...love,
13+
files,
14+
rules: {
15+
...love.rules,
16+
'import/extensions': ['error', 'ignorePackages'],
17+
'import/no-duplicates': ['error', { 'prefer-inline': true }],
18+
'import/no-relative-parent-imports': 'error',
19+
},
20+
},
21+
{
22+
files,
23+
plugins: {
24+
'unused-imports': unusedImports,
25+
},
26+
rules: {
27+
'@typescript-eslint/no-unused-vars': 'off',
28+
'unused-imports/no-unused-imports': 'error',
29+
'unused-imports/no-unused-vars': [
30+
'error',
31+
{
32+
vars: 'all',
33+
varsIgnorePattern: '^_',
34+
args: 'after-used',
35+
argsIgnorePattern: '^_',
36+
ignoreRestSiblings: true,
37+
},
38+
],
39+
},
40+
},
41+
{
42+
files,
43+
plugins: {
44+
'simple-import-sort': simpleImportSort,
45+
},
46+
rules: {
47+
'simple-import-sort/imports': [
48+
'error',
49+
{
50+
groups: [
51+
['^\\u0000'],
52+
['^node:'],
53+
['^@?\\w'],
54+
['@seamapi/makenew-tsmodule'],
55+
['^lib/'],
56+
['^'],
57+
['^\\.'],
58+
],
59+
},
60+
],
61+
'simple-import-sort/exports': 'error',
62+
},
63+
},
64+
{ ...prettier, files },
65+
]

examples/todo.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ export const builder: Builder = {
1919
}
2020

2121
export const handler: Handler<Options> = async ({ x, logger }) => {
22+
await Promise.resolve()
2223
logger.info({ data: todo(x) }, 'TODO')
2324
}

0 commit comments

Comments
 (0)