Skip to content

Commit e5c6a13

Browse files
authored
style: lint all files
I modernized the eslint configuration Back in 25fcdd8. At the time, I chose not to make any changes to the list of filepaths we historically passed to eslint, thinking that maybe this would include a bunch of files (like fixtures) that we intentionally ignore. This turned out to be not the best idea. I didn't notice at the time that the list of filepaths was not great to begin with: We were passing a bunch of file extensions (mjs, cjs) that we no longer have in the repository, and other extensions (md, html) that ESLint doesn't lint. Since ESLint 9, you no longer ever really have reason to pass a path or paths to `eslint` (e.g. you often used to pass `.`, but this is now the implied default). So, this change just changes our use of ESLint to match what the project recommends. This change exposed a lot of unlinted files, so I've fixed or suppressed a minimum of errors in this PR. We can fix these suppressions as we go.
1 parent c84f8ed commit e5c6a13

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+2065
-187
lines changed

e2e/install.e2e.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import http from 'node:http'
22
import os from 'node:os'
33
import events from 'node:events'
44
import { existsSync } from 'node:fs'
5-
import { execSync } from 'node:child_process'
65
import fs from 'node:fs/promises'
76
import { platform } from 'node:os'
87
import path from 'node:path'
@@ -160,7 +159,7 @@ const tests: [packageManager: string, config: { install: [cmd: string, args: str
160159
],
161160
]
162161

163-
describe.each(tests)('%s → installs the cli and runs the help command without error', (packageManager, config) => {
162+
describe.each(tests)('%s → installs the cli and runs the help command without error', (_, config) => {
164163
itWithMockNpmRegistry('installs the cli and runs the help command without error', async ({ registry }) => {
165164
const cwd = registry.cwd
166165
await execa(...config.install, {

eslint.config.js

+3-17
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import node from 'eslint-plugin-n'
88
import vitest from '@vitest/eslint-plugin'
99
import tseslint from 'typescript-eslint'
1010

11+
import cliTemporarySuppressions from './eslint_temporary_suppressions.js'
12+
1113
const __filename = fileURLToPath(import.meta.url)
1214
const __dirname = path.dirname(__filename)
1315

@@ -140,23 +142,7 @@ export default tseslint.config(
140142
},
141143
},
142144

143-
// XXX: Temporarily disabled rules: These rules are disabled because we have offending code that we haven't yet fixed.
144-
{
145-
rules: {
146-
// Empty functions and blocks are useful (e.g `noop() {}`, `catch {}`) but can mask unintentionally omitted
147-
// implementation. We should add explanatory comments like `// intentionally empty` and `// ignore error` in these
148-
// scenarios to communicate intent.
149-
'no-empty': 'off',
150-
'@typescript-eslint/no-empty-function': 'off',
151-
152-
'n/no-unsupported-features/node-builtins': [
153-
'error',
154-
{
155-
ignores: ['FormData', 'ReadableStream', 'Response', 'Request', 'fetch', 'fs/promises.cp'],
156-
},
157-
],
158-
},
159-
},
145+
...cliTemporarySuppressions,
160146

161147
// Must be last
162148
prettier,

0 commit comments

Comments
 (0)