Skip to content

Commit 2e2cbd8

Browse files
authored
Update deps; New eslint config; Fix budgeted fs wrapper bug (#1185)
Update all the dependencies to latest major versions. Only eslint required any changes. Eslint 9 has a new config file format, so I switched to that. I also adopted the new recommended style for typescript-eslint which has some new rules. The new rules found a few style issues, but also a real issue. The real issue was that an await was being omitted in the budgeted fs module. We could also update to using, but let's do that in another PR for the whole project.
1 parent 4d4314f commit 2e2cbd8

17 files changed

+612
-603
lines changed

.eslintignore

-7
This file was deleted.

.eslintrc.cjs

-25
This file was deleted.

CHANGELOG.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic
77
Versioning](https://semver.org/spec/v2.0.0.html).
88

9-
<!-- ## Unreleased -->
9+
## Unreleased
10+
11+
### Fixed
12+
13+
- Fix a bug that may have resulted in Wireit attempting to open too many files
14+
at once (no known reports).
1015

1116
## [0.14.9] - 2024-09-03
1217

eslint.config.js

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/**
2+
* @license
3+
* Copyright 2024 Google LLC
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
import eslint from '@eslint/js';
8+
import noOnlyTests from 'eslint-plugin-no-only-tests';
9+
import tseslint from 'typescript-eslint';
10+
11+
/**
12+
* We want to be able to lint non-TypeScript files. If we don't guard our
13+
* TypeScript rules with a "files" constraint, eslint will try to lint all files
14+
* using the TypeScript parser, which will fail for projects outside a
15+
* TypeScript project. Maybe there is a simpler way to do this?
16+
*/
17+
const onlyTypeScriptFiles = (configs) =>
18+
configs.map((config) => ({files: ['**/*.ts'], ...config}));
19+
20+
export default [
21+
{
22+
// List all visible files:
23+
// npx eslint --debug 2>&1 | grep "eslint:eslint Lint" | cut -f 4- -d" " | sort
24+
ignores: [
25+
'**/.wireit/',
26+
'**/node_modules/',
27+
'lib/',
28+
'vscode-extension/.vscode-test/',
29+
'vscode-extension/lib/',
30+
'vscode-extension/built/',
31+
],
32+
},
33+
eslint.configs.recommended,
34+
...onlyTypeScriptFiles([
35+
...tseslint.configs.strictTypeChecked,
36+
{
37+
languageOptions: {
38+
parserOptions: {
39+
projectService: true,
40+
tsconfigRootDir: import.meta.dirname,
41+
},
42+
},
43+
plugins: {
44+
'no-only-tests': noOnlyTests,
45+
},
46+
rules: {
47+
'no-only-tests/no-only-tests': 'error',
48+
'@typescript-eslint/no-unused-vars': [
49+
'error',
50+
{argsIgnorePattern: '^_', varsIgnorePattern: '^_'},
51+
],
52+
'@typescript-eslint/no-non-null-assertion': 'off',
53+
'@typescript-eslint/no-useless-constructor': 'off',
54+
'@typescript-eslint/only-throw-error': 'off',
55+
'@typescript-eslint/no-confusing-void-expression': 'off',
56+
'@typescript-eslint/restrict-template-expressions': 'off',
57+
'@typescript-eslint/no-unnecessary-condition': 'off',
58+
'@typescript-eslint/no-unnecessary-type-arguments': 'off',
59+
'@typescript-eslint/no-unnecessary-template-expression': 'off',
60+
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'off',
61+
},
62+
},
63+
]),
64+
];

0 commit comments

Comments
 (0)