Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion apps/playwright-browser-tunnel/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

const nodeTrustedToolProfile = require('local-node-rig/profiles/default/includes/eslint/flat/profile/node-trusted-tool');
const friendlyLocalsMixin = require('local-node-rig/profiles/default/includes/eslint/flat/mixins/friendly-locals');
const {
withoutTypeInformation
} = require('local-node-rig/profiles/default/includes/eslint/flat/without-type-information');

module.exports = [
...nodeTrustedToolProfile,
Expand All @@ -14,5 +17,8 @@ module.exports = [
tsconfigRootDir: __dirname
}
}
}
},
// The Playwright config and test files are not part of the project's TypeScript program (they are excluded
// from tsconfig.json), so lint them with only the non-type-aware rules.
...withoutTypeInformation({ files: ['playwright.config.ts', 'tests/**/*.ts'] })
];
3 changes: 3 additions & 0 deletions apps/playwright-browser-tunnel/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.

import { defineConfig, devices } from '@playwright/test';

export default defineConfig({
Expand Down
12 changes: 8 additions & 4 deletions apps/playwright-browser-tunnel/tests/testFixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@
// See LICENSE in the project root for license information.

import { test as base } from '@playwright/test';
import { tunneledBrowser } from '../src/tunneledBrowserConnection';

export const test = base.extend({
import {
createTunneledBrowserAsync,
type IDisposableTunneledBrowser
} from '../src/tunneledBrowserConnection';

export const test: typeof base = base.extend({
browser: [
async ({ browserName, launchOptions, channel, headless }, use) => {
console.log(`Starting tunnel server for browser: ${browserName}, channel: ${channel}`);
console.info(`Starting tunnel server for browser: ${browserName}, channel: ${channel}`);

await using tunnel = await tunneledBrowser(browserName, {
await using tunnel: IDisposableTunneledBrowser = await createTunneledBrowserAsync(browserName, {
channel,
headless,
...launchOptions
Expand Down
5 changes: 5 additions & 0 deletions build-tests/eslint-9-test/.eslint-bulk-suppressions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
"file": "src/index.ts",
"scopeId": ".",
"rule": "@typescript-eslint/naming-convention"
},
{
"file": "src/non-program.custom",
"scopeId": ".",
"rule": "no-undef"
}
]
}
9 changes: 9 additions & 0 deletions build-tests/eslint-9-test/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const nodeTrustedToolProfile = require('local-node-rig/profiles/default/includes
const friendlyLocalsMixin = require('local-node-rig/profiles/default/includes/eslint/flat/mixins/friendly-locals');

module.exports = [
{
ignores: ['coverage/**']
},
...nodeTrustedToolProfile,
...friendlyLocalsMixin,
{
Expand All @@ -25,5 +28,11 @@ module.exports = [
tsconfigRootDir: __dirname
}
}
},
{
files: ['**/*.custom'],
rules: {
'no-undef': 'warn'
}
}
];
48 changes: 48 additions & 0 deletions build-tests/eslint-9-test/src/__snapshots__/sarif.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ Object {
"uri": "src/sarif.test.ts",
},
},
Object {
"location": Object {
"uri": "eslint.config.js",
},
},
Object {
"location": Object {
"uri": "src/non-program.custom",
},
},
],
"results": Array [
Object {
Expand Down Expand Up @@ -78,6 +88,36 @@ Object {
},
],
},
Object {
"level": "warning",
"locations": Array [
Object {
"physicalLocation": Object {
"artifactLocation": Object {
"index": 3,
"uri": "src/non-program.custom",
},
"region": Object {
"endColumn": 14,
"endLine": 1,
"startColumn": 1,
"startLine": 1,
},
},
},
],
"message": Object {
"text": "'missingGlobal' is not defined.",
},
"ruleId": "no-undef",
"ruleIndex": 2,
"suppressions": Array [
Object {
"justification": "",
"kind": "external",
},
],
},
],
"tool": Object {
"driver": Object {
Expand All @@ -100,6 +140,14 @@ Object {
"text": "Enforce naming conventions for everything across a codebase",
},
},
Object {
"helpUri": "https://eslint.org/docs/latest/rules/no-undef",
"id": "no-undef",
"properties": Object {},
"shortDescription": Object {
"text": "Disallow the use of undeclared variables unless mentioned in \`/*global */\` comments",
},
},
],
"version": "9.37.0",
},
Expand Down
1 change: 1 addition & 0 deletions build-tests/eslint-9-test/src/non-program.custom
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
missingGlobal;
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ const nodeProfile = require('local-node-rig/profiles/default/includes/eslint/fla

module.exports = [
...nodeProfile,
// The sandbox contains checked-in fixture repositories (including bootstrap scripts) that are not source
// code for this project and should not be linted.
{
ignores: ['sandbox/**']
},
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"changes": [
{
"packageName": "@rushstack/eslint-config",
"comment": "Globally ignore build-output folders (`lib`, `lib-*`, `dist`, `temp`, `coverage`) so that generated output is not linted, which matters for tools that enumerate files from the ESLint configuration (ESLint's flat config does not respect `.gitignore`).",
"type": "minor"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"changes": [
{
"packageName": "@rushstack/heft-lint-plugin",
"comment": "Lint files selected by ESLint flat config even when they are not part of the TypeScript program.",
"type": "minor"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"changes": [
{
"packageName": "@rushstack/package-extractor",
"comment": "",
"type": "none"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"changes": [
{
"packageName": "@rushstack/playwright-browser-tunnel",
"comment": "",
"type": "none"
}
]
}
7 changes: 7 additions & 0 deletions eslint/eslint-config/src/flat/profile/_common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,13 @@ const commonConfig: Linter.Config[] = [
// so we simply ignore them.
globalIgnores(['**/*.d.ts']) as Linter.Config,

// Build output and other generated folders are not source code and should never be linted. This is
// particularly important for tools that enumerate files from the ESLint configuration itself (rather than
// only linting a known set of source files), since ESLint's flat config does not respect ".gitignore".
// These patterns are anchored to the project root (they are evaluated relative to the cwd), so a source
// folder such as "src/lib" is not affected.
globalIgnores(['lib/**', 'lib-*/**', 'dist/**', 'temp/**', 'coverage/**']) as Linter.Config,

{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
Expand Down
3 changes: 2 additions & 1 deletion eslint/local-eslint-config/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/flat/mixins
/flat/patch
/flat/profile
/flat/profile
/flat/without-type-information.js
Loading
Loading