Skip to content

Commit

Permalink
Update deps; New eslint config; Fix budgeted fs wrapper bug (#1185)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aomarks committed Sep 11, 2024
1 parent 4d4314f commit 2e2cbd8
Show file tree
Hide file tree
Showing 17 changed files with 612 additions and 603 deletions.
7 changes: 0 additions & 7 deletions .eslintignore

This file was deleted.

25 changes: 0 additions & 25 deletions .eslintrc.cjs

This file was deleted.

7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic
Versioning](https://semver.org/spec/v2.0.0.html).

<!-- ## Unreleased -->
## Unreleased

### Fixed

- Fix a bug that may have resulted in Wireit attempting to open too many files
at once (no known reports).

## [0.14.9] - 2024-09-03

Expand Down
64 changes: 64 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/**
* @license
* Copyright 2024 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/

import eslint from '@eslint/js';
import noOnlyTests from 'eslint-plugin-no-only-tests';
import tseslint from 'typescript-eslint';

/**
* We want to be able to lint non-TypeScript files. If we don't guard our
* TypeScript rules with a "files" constraint, eslint will try to lint all files
* using the TypeScript parser, which will fail for projects outside a
* TypeScript project. Maybe there is a simpler way to do this?
*/
const onlyTypeScriptFiles = (configs) =>
configs.map((config) => ({files: ['**/*.ts'], ...config}));

export default [
{
// List all visible files:
// npx eslint --debug 2>&1 | grep "eslint:eslint Lint" | cut -f 4- -d" " | sort
ignores: [
'**/.wireit/',
'**/node_modules/',
'lib/',
'vscode-extension/.vscode-test/',
'vscode-extension/lib/',
'vscode-extension/built/',
],
},
eslint.configs.recommended,
...onlyTypeScriptFiles([
...tseslint.configs.strictTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
plugins: {
'no-only-tests': noOnlyTests,
},
rules: {
'no-only-tests/no-only-tests': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{argsIgnorePattern: '^_', varsIgnorePattern: '^_'},
],
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-useless-constructor': 'off',
'@typescript-eslint/only-throw-error': 'off',
'@typescript-eslint/no-confusing-void-expression': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/no-unnecessary-condition': 'off',
'@typescript-eslint/no-unnecessary-type-arguments': 'off',
'@typescript-eslint/no-unnecessary-template-expression': 'off',
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'off',
},
},
]),
];
Loading

0 comments on commit 2e2cbd8

Please sign in to comment.