Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: support stringly-typed extends#10973

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
24 commits
Select commitHold shift + click to select a range
af837e3
work in progress
kirkwaiblingerMar 19, 2025
1120c01
wip
kirkwaiblingerMar 20, 2025
01d23ed
fix stuff
kirkwaiblingerMar 20, 2025
cf76bfb
lintfixy stuff
kirkwaiblingerMar 20, 2025
4000797
why not work
kirkwaiblingerMar 20, 2025
7f46e57
yay, passing tests!
kirkwaiblingerMar 20, 2025
56af0f7
undo extraneous change
kirkwaiblingerMar 20, 2025
093c180
Merge branch 'main' into add-flat-configs-to-plugin
kirkwaiblingerMar 22, 2025
6da9850
point to the new config locations
kirkwaiblingerMar 22, 2025
e1d0850
ignore dep from website build
kirkwaiblingerMar 26, 2025
48902d8
website mocking take 2
kirkwaiblingerMar 26, 2025
616d9fd
unused var
kirkwaiblingerApr 10, 2025
ef2c6b5
typo
kirkwaiblingerApr 10, 2025
f13959b
Merge branch 'main' into add-flat-configs-to-plugin
kirkwaiblingerApr 10, 2025
7d36b57
up eslint
kirkwaiblingerApr 10, 2025
53a5a99
knip ignore
kirkwaiblingerApr 10, 2025
caec857
alfa
kirkwaiblingerApr 10, 2025
c7b7f71
Revert "up eslint"
kirkwaiblingerApr 10, 2025
7177a6a
fix up resolution stuff
kirkwaiblingerApr 10, 2025
97d1346
is it this
kirkwaiblingerApr 10, 2025
a6f0044
Revert "is it this"
kirkwaiblingerApr 10, 2025
8a41179
uhhh
kirkwaiblingerApr 10, 2025
1ba30d6
fixup
kirkwaiblingerApr 10, 2025
39228c2
fixup
kirkwaiblingerApr 10, 2025
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
26 changes: 13 additions & 13 deletionsdocs/users/Shared_Configurations.mdx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -144,7 +144,7 @@ module.exports = {
</TabItem>
</Tabs>

See [`configs/recommended.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/recommended.ts) for the exact contents of this config.
See [`configs/recommended.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/recommended.ts) for the exact contents of this config.

### `recommended-type-checked`

Expand DownExpand Up@@ -173,7 +173,7 @@ module.exports = {
</TabItem>
</Tabs>

See [`configs/recommended-type-checked.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/recommended-type-checked.ts) for the exact contents of this config.
See [`configs/recommended-type-checked.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/recommended-type-checked.ts) for the exact contents of this config.

### `strict`

Expand DownExpand Up@@ -203,7 +203,7 @@ module.exports = {
</Tabs>

Some rules also enabled in `recommended` default to more strict settings in this configuration.
See [`configs/strict.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/strict.ts) for the exact contents of this config.
See [`configs/strict.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/strict.ts) for the exact contents of this config.

:::tip
We recommend a TypeScript project extend from `plugin:@typescript-eslint/strict` only if a nontrivial percentage of its developers are highly proficient in TypeScript.
Expand DownExpand Up@@ -242,7 +242,7 @@ module.exports = {
</Tabs>

Some rules also enabled in `recommended-type-checked` default to more strict settings in this configuration.
See [`configs/strict-type-checked.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/strict-type-checked.ts) for the exact contents of this config.
See [`configs/strict-type-checked.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked.ts) for the exact contents of this config.

:::tip
We recommend a TypeScript project extend from `plugin:@typescript-eslint/strict-type-checked` only if a nontrivial percentage of its developers are highly proficient in TypeScript.
Expand DownExpand Up@@ -283,7 +283,7 @@ module.exports = {
Note that `stylistic` does not replace `recommended` or `strict`.
`stylistic` adds additional rules.

See [`configs/stylistic.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/stylistic.ts) for the exact contents of this config.
See [`configs/stylistic.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/stylistic.ts) for the exact contents of this config.

### `stylistic-type-checked`

Expand DownExpand Up@@ -315,7 +315,7 @@ module.exports = {
Note that `stylistic-type-checked` does not replace `recommended-type-checked` or `strict-type-checked`.
`stylistic-type-checked` adds additional rules.

See [`configs/stylistic-type-checked.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/stylistic-type-checked.ts) for the exact contents of this config.
See [`configs/stylistic-type-checked.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked.ts) for the exact contents of this config.

## Other Configurations

Expand All@@ -326,7 +326,7 @@ typescript-eslint includes a few utility configurations.
Enables each the rules provided as a part of typescript-eslint.
Note that many rules are not applicable in all codebases, or are meant to be configured.

See [`configs/all.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/all.ts) for the exact contents of this config.
See [`configs/all.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/all.ts) for the exact contents of this config.

:::warning
We do not recommend TypeScript projects extend from `plugin:@typescript-eslint/all`.
Expand All@@ -345,14 +345,14 @@ We don't recommend using this directly; instead, extend from an earlier recommen

This config is automatically included if you use any of the recommended configurations.

See [`configs/base.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/base.ts) for the exact contents of this config.
See [`configs/base.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/base.ts) for the exact contents of this config.

### `disable-type-checked`

A utility ruleset that will disable type-aware linting and all type-aware rules available in our project.
This config is useful if you'd like to have your base config concerned with type-aware linting, and then conditionally use [overrides](https://eslint.org/docs/latest/use/configure/configuration-files#configuration-based-on-glob-patterns) to disable type-aware linting on specific subsets of your codebase.

See [`configs/disable-type-checked.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/disable-type-checked.ts) for the exact contents of this config.
See [`configs/disable-type-checked.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/disable-type-checked.ts) for the exact contents of this config.

:::info
If you use type-aware rules from other plugins, you will need to manually disable these rules or use a premade config they provide to disable them.
Expand DownExpand Up@@ -449,7 +449,7 @@ module.exports = {

This config is automatically included if you use any of the recommended configurations.

See [`configs/eslint-recommended.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslint-recommended.ts) for the exact contents of this config.
See [`configs/eslint-recommended.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/eslint-recommended.ts) for the exact contents of this config.

### `recommended-type-checked-only`

Expand All@@ -462,7 +462,7 @@ module.exports = {
};
```

See [`configs/recommended-type-checked-only.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/recommended-type-checked-only.ts) for the exact contents of this config.
See [`configs/recommended-type-checked-only.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/recommended-type-checked-only.ts) for the exact contents of this config.

### `strict-type-checked-only`

Expand All@@ -475,7 +475,7 @@ module.exports = {
};
```

See [`configs/strict-type-checked-only.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/strict-type-checked-only.ts) for the exact contents of this config.
See [`configs/strict-type-checked-only.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked-only.ts) for the exact contents of this config.

:::warning
This configuration is not considered "stable" under Semantic Versioning (semver).
Expand All@@ -493,7 +493,7 @@ module.exports = {
};
```

See [`configs/stylistic-type-checked-only.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/stylistic-type-checked-only.ts) for the exact contents of this config.
See [`configs/stylistic-type-checked-only.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked-only.ts) for the exact contents of this config.

## Suggesting Configuration Changes

Expand Down
4 changes: 2 additions & 2 deletionseslint.config.mjs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -645,9 +645,9 @@ export default tseslint.config(
{
files: ['**/*'],
ignores: [
'packages/eslint-plugin/src/configs/*',
'packages/eslint-plugin/src/configs/eslintrc/*',
'packages/eslint-plugin/src/configs/flat/*',
'packages/scope-manager/src/configs/*',
'packages/typescript-eslint/src/configs/*',
],
rules: {
'@typescript-eslint/sort-type-constituents': 'off',
Expand Down
1 change: 1 addition & 0 deletionsknip.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -134,6 +134,7 @@ export default {
'src/mock/eslint-rules.js',
'src/mock/eslint.js',
'src/mock/lru-cache.js',
'src/mock/parser.js',
'src/mock/path.js',
'src/mock/typescript.js',
'src/mock/util.js',
Expand Down
3 changes: 2 additions & 1 deletionpackage.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -148,7 +148,8 @@
"react-split-pane@^0.1.92": "patch:react-split-pane@npm%3A0.1.92#./.yarn/patches/react-split-pane-npm-0.1.92-93dbf51dff.patch",
"tmp": "0.2.1",
"tsx": "^4.7.2",
"typescript": "5.8.2"
"typescript": "5.8.2",
"@eslint/config-helpers": "^0.2.0"
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This manual resolution is required pending release of the next version of eslint (eslint/eslint#19533 has been merged but not yet released)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

We're clear to remove this now, right?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

well, on main we still have

├─ eslint@npm:9.22.0│  └─ @eslint/config-helpers@npm:0.1.0 (via npm:^0.1.0)│└─ eslint@npm:9.22.0 [43684]   └─ @eslint/config-helpers@npm:0.1.0 (via npm:^0.1.0)

so we need either this or to upgrade eslint past9.23

Copy link
MemberAuthor

@kirkwaiblingerkirkwaiblingerApr 10, 2025
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

(I've implemented the latter, updating our eslint dependency) I've kept theresolutions since I had some CI failures that I had a hard time debugging when I tried upgrading the eslint version.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

but yeah once main has eslint >= 9.23 we can remove it.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Fun. I just clicked the checkmark in#6687 to start the Renovate PR.

kirkwaiblinger reacted with thumbs up emoji
},
"packageManager": "yarn@3.8.2",
"nx": {
Expand Down
5 changes: 0 additions & 5 deletionspackages/eslint-plugin/eslint-recommended-raw.d.ts
View file
Open in desktop

This file was deleted.

8 changes: 4 additions & 4 deletionspackages/eslint-plugin/package.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,8 +6,8 @@
"dist",
"!*.tsbuildinfo",
"docs",
"eslint-recommended-raw.d.ts",
"index.d.ts",
"raw-plugin.d.ts",
"rules.d.ts",
"package.json",
"README.md",
Expand All@@ -24,9 +24,9 @@
"types": "./rules.d.ts",
"default": "./dist/rules/index.js"
},
"./use-at-your-own-risk/eslint-recommended-raw": {
"types": "./eslint-recommended-raw.d.ts",
"default": "./dist/configs/eslint-recommended-raw.js"
"./use-at-your-own-risk/raw-plugin": {
"types": "./raw-plugin.d.ts",
"default": "./dist/raw-plugin.js"
}
},
"engines": {
Expand Down
25 changes: 25 additions & 0 deletionspackages/eslint-plugin/raw-plugin.d.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';

import type plugin from './index';

declare const cjsExport: {
flatConfigs: {
'flat/all': FlatConfig.ConfigArray;
'flat/base': FlatConfig.Config;
'flat/disable-type-checked': FlatConfig.Config;
'flat/eslint-recommended': FlatConfig.Config;
'flat/recommended': FlatConfig.ConfigArray;
'flat/recommended-type-checked': FlatConfig.ConfigArray;
'flat/recommended-type-checked-only': FlatConfig.ConfigArray;
'flat/strict': FlatConfig.ConfigArray;
'flat/strict-type-checked': FlatConfig.ConfigArray;
'flat/strict-type-checked-only': FlatConfig.ConfigArray;
'flat/stylistic': FlatConfig.ConfigArray;
'flat/stylistic-type-checked': FlatConfig.ConfigArray;
'flat/stylistic-type-checked-only': FlatConfig.ConfigArray;
};
parser: FlatConfig.Parser;
plugin: typeof plugin;
};

export = cjsExport;
10 changes: 4 additions & 6 deletionspackages/eslint-plugin/src/configs/eslint-recommended-raw.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
// NOTE: this file is isolated to be shared across legacy and flat configs
// it is exported via `./use-at-your-own-risk/eslint-recommended-raw`
// and it has types manually defined in `./eslint-recommended-raw.d.ts`
// NOTE: this file is isolated to be shared across legacy and flat configs.

/**
* This is a compatibility ruleset that:
Expand All@@ -11,7 +9,7 @@ const config = (
style: 'glob' | 'minimatch',
): {
files: string[];
rules: Record<string, 'off' | 'warn' | 'error'>;
rules: Record<string, 'error' | 'off' | 'warn'>;
} => ({
files:
style === 'glob'
Expand All@@ -30,8 +28,8 @@ const config = (
'no-func-assign': 'off', // ts(2630)
'no-import-assign': 'off', // ts(2632) & ts(2540)
// TODO - remove this once we no longer support ESLint v8
'no-new-symbol': 'off', // ts(7009)
'no-new-native-nonconstructor': 'off', // ts(7009)
'no-new-symbol': 'off', // ts(7009)
'no-obj-calls': 'off', // ts(2349)
'no-redeclare': 'off', // ts(2451)
'no-setter-return': 'off', // ts(2408)
Expand All@@ -40,10 +38,10 @@ const config = (
'no-unreachable': 'off', // ts(7027)
'no-unsafe-negation': 'off', // ts(2365) & ts(2322) & ts(2358)
'no-var': 'error', // ts transpiles let/const to var, so no need for vars any more
'no-with': 'off', // ts(1101) & ts(2410)
'prefer-const': 'error', // ts provides better types with const
'prefer-rest-params': 'error', // ts provides better types with rest args over arguments
'prefer-spread': 'error', // ts transpiles spread to apply, so no need for manual apply
'no-with': 'off', // ts(1101) & ts(2410)
},
});

Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@

import type { ClassicConfig } from '@typescript-eslint/utils/ts-eslint';

import eslintRecommended_raw from './eslint-recommended-raw';
import eslintRecommended_raw from '../eslint-recommended-raw';

export = {
overrides: [eslintRecommended_raw('glob')],
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';

import config from '@typescript-eslint/eslint-plugin/use-at-your-own-risk/eslint-recommended-raw';
import config from '../eslint-recommended-raw';

/**
* This is a compatibility ruleset that:
Expand Down
52 changes: 2 additions & 50 deletionspackages/eslint-plugin/src/index.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,3 @@
importtype { Linter }from '@typescript-eslint/utils/ts-eslint';
importrawPluginfrom './raw-plugin';

import all from './configs/all';
import base from './configs/base';
import disableTypeChecked from './configs/disable-type-checked';
import eslintRecommended from './configs/eslint-recommended';
import recommended from './configs/recommended';
import recommendedTypeChecked from './configs/recommended-type-checked';
import recommendedTypeCheckedOnly from './configs/recommended-type-checked-only';
import strict from './configs/strict';
import strictTypeChecked from './configs/strict-type-checked';
import strictTypeCheckedOnly from './configs/strict-type-checked-only';
import stylistic from './configs/stylistic';
import stylisticTypeChecked from './configs/stylistic-type-checked';
import stylisticTypeCheckedOnly from './configs/stylistic-type-checked-only';
import rules from './rules';

// note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder
const { name, version } = require('../package.json') as {
name: string;
version: string;
};

const configs = {
all,
base,
'disable-type-checked': disableTypeChecked,
'eslint-recommended': eslintRecommended,
recommended,
/** @deprecated - please use "recommended-type-checked" instead. */
'recommended-requiring-type-checking': recommendedTypeChecked,
'recommended-type-checked': recommendedTypeChecked,
'recommended-type-checked-only': recommendedTypeCheckedOnly,
strict,
'strict-type-checked': strictTypeChecked,
'strict-type-checked-only': strictTypeCheckedOnly,
stylistic,
'stylistic-type-checked': stylisticTypeChecked,
'stylistic-type-checked-only': stylisticTypeCheckedOnly,
};

const meta = {
name,
version,
};

export = {
configs,
meta,
rules,
} satisfies Linter.Plugin;
export = rawPlugin.plugin;
Loading
Loading

[8]ページ先頭

©2009-2025 Movatter.jp