Skip to content

Commit 0f7a0f1

Browse files
vdiezzglicz
andauthored
JS-837 Update ESLint to 9.33.0 (#5635)
Co-authored-by: Michal Zgliczynski <[email protected]>
1 parent d8faf6a commit 0f7a0f1

File tree

10 files changed

+483
-430
lines changed

10 files changed

+483
-430
lines changed

package-lock.json

Lines changed: 460 additions & 413 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
},
6262
"type": "module",
6363
"devDependencies": {
64+
"@eslint/core": "0.15.2",
6465
"@inquirer/prompts": "7.8.0",
6566
"@istanbuljs/esm-loader-hook": "0.3.0",
6667
"@types/babel__preset-env": "7.10.0",
@@ -116,7 +117,7 @@
116117
"@typescript/native-preview": "7.0.0-dev.20250807.1",
117118
"builtin-modules": "3.3.0",
118119
"bytes": "3.1.2",
119-
"eslint": "9.31.0",
120+
"eslint": "9.33.0",
120121
"eslint-plugin-import": "2.32.0",
121122
"eslint-plugin-jsx-a11y": "6.10.2",
122123
"eslint-plugin-react": "7.37.5",

packages/jsts/src/linter/pragmas.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export function createOptions(filename: string) {
6868
filename,
6969
allowInlineConfig: true,
7070
getRule: (ruleId: string) => eslintMapping[getRuleId(ruleId)]?.ruleId,
71-
patchDirectives: ({ disableDirectives }: { disableDirectives: Directive[] }) =>
71+
patchDirectives: (disableDirectives: Directive[]) =>
7272
disableDirectives.forEach(directive => {
7373
if (!eslintMapping[getRuleId(directive.ruleId)]) {
7474
return;

packages/jsts/src/rules/helpers/aws/cdk.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
* along with this program; if not, see https://sonarsource.com/license/ssal/
1616
*/
1717
import type { Rule } from 'eslint';
18+
19+
import type { RulesMeta } from '@eslint/core';
1820
import type estree from 'estree';
1921
import { getFullyQualifiedName } from '../module.js';
2022
import {
@@ -67,7 +69,7 @@ type AwsCdkConsumerMap = { [key: FullyQualifiedName]: AwsCdkConsumer };
6769
*/
6870
export function AwsCdkTemplate(
6971
mapOrFactory: AwsCdkConsumerMap | ((ctx: Rule.RuleContext) => AwsCdkConsumerMap),
70-
meta: Rule.RuleMetaData = {},
72+
meta: RulesMeta = {},
7173
): Rule.RuleModule {
7274
return {
7375
meta,

packages/jsts/src/rules/helpers/aws/iam.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { AwsCdkTemplate, normalizeFQN } from './cdk.js';
2020
import { getResultOfExpression, Result } from '../result.js';
2121
import { flattenArgs, isStringLiteral, StringLiteral } from '../ast.js';
2222
import { getFullyQualifiedName } from '../module.js';
23+
import { RulesMeta } from '@eslint/core';
2324

2425
export interface PolicyCheckerOptions {
2526
effect: {
@@ -99,7 +100,7 @@ const JSON_OPTIONS: PolicyCheckerOptions = {
99100
},
100101
};
101102

102-
export function AwsIamPolicyTemplate(statementChecker: StatementChecker, meta: Rule.RuleMetaData) {
103+
export function AwsIamPolicyTemplate(statementChecker: StatementChecker, meta: RulesMeta) {
103104
return AwsCdkTemplate(
104105
{
105106
'aws-cdk-lib.aws-iam.PolicyStatement': {

packages/jsts/src/rules/helpers/aws/s3.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
toSecondaryLocation,
2727
} from '../index.js';
2828
import { normalizeFQN } from './cdk.js';
29+
import { RulesMeta } from '@eslint/core';
2930

3031
/**
3132
* A rule template for AWS S3 Buckets
@@ -41,7 +42,7 @@ import { normalizeFQN } from './cdk.js';
4142
*/
4243
export function S3BucketTemplate(
4344
callback: (bucketConstructor: estree.NewExpression, context: Rule.RuleContext) => void,
44-
meta: Rule.RuleMetaData = {},
45+
meta: RulesMeta = {},
4546
): Rule.RuleModule {
4647
return {
4748
meta,

packages/jsts/src/rules/helpers/express.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
report,
2626
toSecondaryLocation,
2727
} from './index.js';
28+
import { RulesMeta } from '@eslint/core';
2829

2930
/**
3031
* This modules provides utilities for writing rules about Express.js.
@@ -133,7 +134,7 @@ export namespace Express {
133134
middlewareCall: estree.CallExpression,
134135
) => estree.Property[],
135136
message: string,
136-
meta: Rule.RuleMetaData = {},
137+
meta: RulesMeta = {},
137138
): Rule.RuleModule {
138139
return {
139140
meta,

packages/jsts/src/rules/helpers/generate-meta.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* along with this program; if not, see https://sonarsource.com/license/ssal/
1616
*/
1717
import type { Rule } from 'eslint';
18+
import type { RulesMeta } from '@eslint/core';
1819
import type { JSONSchema4 } from '@typescript-eslint/utils/json-schema';
1920
import { ESLintConfiguration } from './configs.js';
2021
import merge from 'lodash.merge';
@@ -31,10 +32,7 @@ export type SonarMeta = {
3132
fields?: ESLintConfiguration;
3233
};
3334

34-
export function generateMeta(
35-
sonarMeta: SonarMeta,
36-
ruleMeta?: Rule.RuleMetaData,
37-
): Rule.RuleMetaData {
35+
export function generateMeta(sonarMeta: SonarMeta, ruleMeta?: RulesMeta): RulesMeta {
3836
if (sonarMeta.meta.fixable && !ruleMeta?.fixable && !ruleMeta?.hasSuggestions) {
3937
throw new Error(
4038
`Mismatch between RSPEC metadata and implementation for fixable attribute in rule ${sonarMeta.meta.docs!.url}`,

packages/jsts/src/rules/helpers/regex/rule-template.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* along with this program; if not, see https://sonarsource.com/license/ssal/
1616
*/
1717
import type { Rule } from 'eslint';
18+
import type { RulesMeta } from '@eslint/core';
1819
import type estree from 'estree';
1920
import * as regexpp from '@eslint-community/regexpp';
2021
import type { RegExpVisitor } from '@eslint-community/regexpp/visitor';
@@ -52,7 +53,7 @@ type RegexReportDescriptor = RegexReportData & RegexReportMessage & RegexReportO
5253
*/
5354
export function createRegExpRule(
5455
handlers: (context: RegexRuleContext) => RegExpVisitor.Handlers,
55-
meta: Rule.RuleMetaData = {},
56+
meta: RulesMeta = {},
5657
): Rule.RuleModule {
5758
return {
5859
meta,

patches/eslint+9.29.0.patch renamed to patches/eslint+9.33.0.patch

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/node_modules/eslint/lib/linter/linter.js b/node_modules/eslint/lib/linter/linter.js
2-
index db059b2..76b7a6b 100644
2+
index f46f5e3..aa203b9 100755
33
--- a/node_modules/eslint/lib/linter/linter.js
44
+++ b/node_modules/eslint/lib/linter/linter.js
5-
@@ -2074,7 +2074,7 @@ class Linter {
5+
@@ -1934,7 +1934,7 @@ class Linter {
66
loc,
77
} of inlineConfigResult.configs) {
88
Object.keys(inlineConfig.rules).forEach(ruleId => {
@@ -11,16 +11,17 @@ index db059b2..76b7a6b 100644
1111
const ruleValue = inlineConfig.rules[ruleId];
1212

1313
if (!rule) {
14-
@@ -2233,11 +2233,18 @@ class Linter {
14+
@@ -2084,12 +2084,19 @@ class Linter {
1515
options.allowInlineConfig && !options.warnInlineConfig
1616
? getDirectiveCommentsForFlatConfig(
1717
sourceCode,
1818
- ruleId => config.getRuleDefinition(ruleId),
19-
+ ruleId => (providedOptions.getRule ?? config.getRuleDefinition)(ruleId),
19+
+ ruleId => (providedOptions.getRule ?? config.getRuleDefinition)(ruleId),
2020
config.language,
21+
report,
2122
)
22-
: { problems: [], disableDirectives: [] };
23-
23+
: [];
24+
2425
+ if (typeof providedOptions.patchInlineOptions === "function") {
2526
+ providedOptions.patchInlineOptions(mergedInlineConfig);
2627
+ }

0 commit comments

Comments
 (0)