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
528 changes: 144 additions & 384 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
"prepare": "husky || true"
},
"devDependencies": {
"cross-env": "^10.0.0",
"cross-env": "^10.1.0",
"husky": "^9.1.7",
"jest": "^30.1.3",
"rimraf": "^6.0.1",
"semver": "^7.7.2",
"ts-jest": "^29.4.2"
"jest": "^30.2.0",
"rimraf": "^6.1.2",
"semver": "^7.7.3",
"ts-jest": "^29.4.6"
},
"jest": {
"testTimeout": 60000,
Expand Down
2 changes: 1 addition & 1 deletion packages/ENGINE-TEMPLATE/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"types": "dist/index.d.ts",
"dependencies": {
"@types/node": "^20.0.0",
"@salesforce/code-analyzer-engine-api": "0.33.0"
"@salesforce/code-analyzer-engine-api": "0.34.0-SNAPSHOT"
},
"devDependencies": {
"@eslint/js": "^9.39.2",
Expand Down
6 changes: 3 additions & 3 deletions packages/code-analyzer-core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@salesforce/code-analyzer-core",
"description": "Core Package for the Salesforce Code Analyzer",
"version": "0.41.0",
"version": "0.42.0-SNAPSHOT",
"author": "The Salesforce Code Analyzer Team",
"license": "BSD-3-Clause",
"homepage": "https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/overview",
Expand All @@ -16,7 +16,7 @@
},
"types": "dist/index.d.ts",
"dependencies": {
"@salesforce/code-analyzer-engine-api": "0.33.0",
"@salesforce/code-analyzer-engine-api": "0.34.0-SNAPSHOT",
"@types/node": "^20.0.0",
"csv-stringify": "^6.6.0",
"js-yaml": "^4.1.1",
Expand All @@ -35,7 +35,7 @@
"rimraf": "^6.1.2",
"ts-jest": "^29.4.6",
"typescript": "^5.9.3",
"typescript-eslint": "^8.50.0"
"typescript-eslint": "^8.53.0"
},
"engines": {
"node": ">=20.0.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/code-analyzer-engine-api/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@salesforce/code-analyzer-engine-api",
"description": "Engine API Package for the Salesforce Code Analyzer",
"version": "0.33.0",
"version": "0.34.0-SNAPSHOT",
"author": "The Salesforce Code Analyzer Team",
"license": "BSD-3-Clause",
"homepage": "https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/overview",
Expand All @@ -26,7 +26,7 @@
"rimraf": "^6.1.2",
"ts-jest": "^29.4.6",
"typescript": "^5.9.3",
"typescript-eslint": "^8.50.0"
"typescript-eslint": "^8.53.0"
},
"engines": {
"node": ">=20.0.0"
Expand Down
20 changes: 10 additions & 10 deletions packages/code-analyzer-eslint-engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,28 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"dependencies": {
"@babel/preset-react": "^7.27.1",
"@babel/preset-react": "^7.28.5",
"@eslint/js": "^9.39.2",
"@lwc/eslint-plugin-lwc": "^3.3.0",
"@lwc/eslint-plugin-lwc-platform": "^6.3.0",
"@salesforce-ux/eslint-plugin-slds": "^1.0.7",
"@salesforce/code-analyzer-engine-api": "0.33.0",
"@salesforce/code-analyzer-eslint8-engine": "0.10.0",
"@salesforce-ux/eslint-plugin-slds": "^1.1.0",
"@salesforce/code-analyzer-engine-api": "0.34.0-SNAPSHOT",
"@salesforce/code-analyzer-eslint8-engine": "0.11.0-SNAPSHOT",
"@salesforce/eslint-config-lwc": "^4.1.2",
"@salesforce/eslint-plugin-lightning": "^2.0.0",
"@types/node": "^20.0.0",
"@typescript-eslint/eslint-plugin": "^8.50.0",
"@typescript-eslint/parser": "^8.50.0",
"@typescript-eslint/eslint-plugin": "^8.53.0",
"@typescript-eslint/parser": "^8.53.0",
"eslint": "^9.39.2",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jest": "^29.5.0",
"eslint-plugin-jest": "^29.12.1",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^7.0.1",
"globals": "^16.5.0",
"globals": "^17.0.0",
"semver": "^7.7.3",
"typescript": "^5.9.3",
"typescript-eslint": "^8.50.0"
"typescript-eslint": "^8.53.0"
},
"devDependencies": {
"@types/jest": "^30.0.0",
Expand Down
6 changes: 5 additions & 1 deletion packages/code-analyzer-eslint-engine/src/base-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,13 @@ export class BaseConfigFactory {
const lwcFilePatterns = lwcExtensions.map(ext => `**/*${ext}`);

// Base JS rules (eslintJs.configs.all) - applies to ALL JS files including .jsx
// Includes Babel parser with @babel/preset-react to enable JSX parsing for .jsx files
const baseJsConfig: Linter.Config = {
...eslintJs.configs.all,
files: allJsFilePatterns
files: allJsFilePatterns,
languageOptions: {
...configs[0].languageOptions // Reuses Babel parser with @babel/preset-react
}
};

// This one rule makes eslint throw an exception if the user doesn't have jest installed (which should be
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,10 @@ export const RULE_MAPPINGS_TYPESCRIPT_ESLINT: Record<string, {severity: Severity
severity: SeverityLevel.Moderate,
tags: [/* NOT RECOMMENDED */ COMMON_TAGS.CATEGORIES.BEST_PRACTICES, COMMON_TAGS.LANGUAGES.TYPESCRIPT]
},
"@typescript-eslint/strict-void-return": {
severity: SeverityLevel.High,
tags: [/* NOT RECOMMENDED */ COMMON_TAGS.CATEGORIES.ERROR_PRONE, COMMON_TAGS.LANGUAGES.TYPESCRIPT]
},
"@typescript-eslint/switch-exhaustiveness-check": {
severity: SeverityLevel.Moderate,
tags: [/* NOT RECOMMENDED */ COMMON_TAGS.CATEGORIES.BEST_PRACTICES, COMMON_TAGS.LANGUAGES.TYPESCRIPT]
Expand Down
25 changes: 25 additions & 0 deletions packages/code-analyzer-eslint-engine/test/engine.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,31 @@ describe('Typical tests for the runRules method of ESLintEngine', () => {
v.codeLocations[0].file.endsWith('.jsx'));
expect(jsxViolations.length).toBe(0);
});

it('When runRules is called on .jsx files with LWC+JS configs enabled but React disabled, JSX parsing still works', async () => {
// This is a regression test for the bug where .jsx files failed to parse with "Unexpected token <"
// when both LWC and JS base configs were enabled. The issue was that .jsx files were excluded from
// the LWC config patterns, so they didn't get the Babel preset-react parser.
const configWithoutReact: ESLintEngineConfig = {
...DEFAULT_CONFIG,
config_root: __dirname,
disable_lwc_base_config: false,
disable_javascript_base_config: false,
disable_react_base_config: true // React rules disabled, but JSX parsing should still work
};
const engine: Engine = await createEngineFromPlugin(configWithoutReact);
const runOptions: RunOptions = createRunOptions(new Workspace('id', [workspaceWithReactFiles]));

// Run a base JS rule on .jsx files - if JSX parsing fails, this will throw an error
const results: EngineRunResults = await engine.runRules(['no-console'], runOptions);

// Should have violations from .jsx files (App.jsx has console.log)
// If JSX parsing failed, we'd get errors instead of violations
const jsxViolations = results.violations.filter(v =>
v.codeLocations[0].file.endsWith('.jsx'));
expect(jsxViolations.length).toBeGreaterThan(0);
expect(jsxViolations.every(v => v.ruleName === 'no-console')).toBe(true);
});
});

describe('Tests for React Hooks rules', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@
"description": "Enforce assertion to be made in a test body",
"name": "jest/expect-expect",
"resourceUrls": [
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/expect-expect.md"
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.12.1/docs/rules/expect-expect.md"
],
"severityLevel": 5,
"tags": [
Expand All @@ -685,7 +685,7 @@
"description": "Disallow alias methods",
"name": "jest/no-alias-methods",
"resourceUrls": [
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/no-alias-methods.md"
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.12.1/docs/rules/no-alias-methods.md"
],
"severityLevel": 3,
"tags": [
Expand All @@ -699,7 +699,7 @@
"description": "Disallow commented out tests",
"name": "jest/no-commented-out-tests",
"resourceUrls": [
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/no-commented-out-tests.md"
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.12.1/docs/rules/no-commented-out-tests.md"
],
"severityLevel": 5,
"tags": [
Expand All @@ -713,7 +713,7 @@
"description": "Disallow calling `expect` conditionally",
"name": "jest/no-conditional-expect",
"resourceUrls": [
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/no-conditional-expect.md"
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.12.1/docs/rules/no-conditional-expect.md"
],
"severityLevel": 2,
"tags": [
Expand All @@ -727,7 +727,7 @@
"description": "Disallow disabled tests",
"name": "jest/no-disabled-tests",
"resourceUrls": [
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/no-disabled-tests.md"
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.12.1/docs/rules/no-disabled-tests.md"
],
"severityLevel": 5,
"tags": [
Expand All @@ -741,7 +741,7 @@
"description": "Disallow using a callback in asynchronous tests and hooks",
"name": "jest/no-done-callback",
"resourceUrls": [
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/no-done-callback.md"
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.12.1/docs/rules/no-done-callback.md"
],
"severityLevel": 3,
"tags": [
Expand All @@ -755,7 +755,7 @@
"description": "Disallow using `exports` in files containing tests",
"name": "jest/no-export",
"resourceUrls": [
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/no-export.md"
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.12.1/docs/rules/no-export.md"
],
"severityLevel": 3,
"tags": [
Expand All @@ -769,7 +769,7 @@
"description": "Disallow focused tests",
"name": "jest/no-focused-tests",
"resourceUrls": [
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/no-focused-tests.md"
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.12.1/docs/rules/no-focused-tests.md"
],
"severityLevel": 3,
"tags": [
Expand All @@ -783,7 +783,7 @@
"description": "Disallow identical titles",
"name": "jest/no-identical-title",
"resourceUrls": [
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/no-identical-title.md"
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.12.1/docs/rules/no-identical-title.md"
],
"severityLevel": 3,
"tags": [
Expand All @@ -797,7 +797,7 @@
"description": "Disallow string interpolation inside snapshots",
"name": "jest/no-interpolation-in-snapshots",
"resourceUrls": [
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/no-interpolation-in-snapshots.md"
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.12.1/docs/rules/no-interpolation-in-snapshots.md"
],
"severityLevel": 2,
"tags": [
Expand All @@ -811,7 +811,7 @@
"description": "Disallow Jasmine globals",
"name": "jest/no-jasmine-globals",
"resourceUrls": [
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/no-jasmine-globals.md"
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.12.1/docs/rules/no-jasmine-globals.md"
],
"severityLevel": 3,
"tags": [
Expand All @@ -825,7 +825,7 @@
"description": "Disallow manually importing from `__mocks__`",
"name": "jest/no-mocks-import",
"resourceUrls": [
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/no-mocks-import.md"
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.12.1/docs/rules/no-mocks-import.md"
],
"severityLevel": 2,
"tags": [
Expand All @@ -839,7 +839,7 @@
"description": "Disallow using `expect` outside of `it` or `test` blocks",
"name": "jest/no-standalone-expect",
"resourceUrls": [
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/no-standalone-expect.md"
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.12.1/docs/rules/no-standalone-expect.md"
],
"severityLevel": 3,
"tags": [
Expand All @@ -853,7 +853,7 @@
"description": "Require using `.only` and `.skip` over `f` and `x`",
"name": "jest/no-test-prefixes",
"resourceUrls": [
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/no-test-prefixes.md"
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.12.1/docs/rules/no-test-prefixes.md"
],
"severityLevel": 3,
"tags": [
Expand All @@ -867,7 +867,7 @@
"description": "Enforce valid `describe()` callback",
"name": "jest/valid-describe-callback",
"resourceUrls": [
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/valid-describe-callback.md"
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.12.1/docs/rules/valid-describe-callback.md"
],
"severityLevel": 2,
"tags": [
Expand All @@ -881,7 +881,7 @@
"description": "Enforce valid `expect()` usage",
"name": "jest/valid-expect",
"resourceUrls": [
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/valid-expect.md"
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.12.1/docs/rules/valid-expect.md"
],
"severityLevel": 3,
"tags": [
Expand All @@ -895,7 +895,7 @@
"description": "Require promises that have expectations in their chain to be valid",
"name": "jest/valid-expect-in-promise",
"resourceUrls": [
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/valid-expect-in-promise.md"
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.12.1/docs/rules/valid-expect-in-promise.md"
],
"severityLevel": 3,
"tags": [
Expand All @@ -909,7 +909,7 @@
"description": "Enforce valid titles",
"name": "jest/valid-title",
"resourceUrls": [
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.5.0/docs/rules/valid-title.md"
"https://github.com/jest-community/eslint-plugin-jest/blob/v29.12.1/docs/rules/valid-title.md"
],
"severityLevel": 3,
"tags": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1470,6 +1470,18 @@
"TypeScript"
]
},
{
"description": "Disallow passing a value-returning function in a position accepting a void function",
"name": "@typescript-eslint/strict-void-return",
"resourceUrls": [
"https://typescript-eslint.io/rules/strict-void-return"
],
"severityLevel": 2,
"tags": [
"ErrorProne",
"TypeScript"
]
},
{
"description": "Require switch-case statements to be exhaustive",
"name": "@typescript-eslint/switch-exhaustiveness-check",
Expand Down
4 changes: 2 additions & 2 deletions packages/code-analyzer-eslint8-engine/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@salesforce/code-analyzer-eslint8-engine",
"description": "Plugin package that adds 'eslint' (version 8) as an engine into Salesforce Code Analyzer",
"version": "0.10.0",
"version": "0.11.0-SNAPSHOT",
"author": "The Salesforce Code Analyzer Team",
"license": "BSD-3-Clause",
"homepage": "https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/overview",
Expand All @@ -18,7 +18,7 @@
"@eslint/js": "8.57.1",
"@lwc/eslint-plugin-lwc": "2.2.0",
"@lwc/eslint-plugin-lwc-platform": "5.2.0",
"@salesforce/code-analyzer-engine-api": "0.33.0",
"@salesforce/code-analyzer-engine-api": "0.34.0-SNAPSHOT",
"@salesforce/eslint-config-lwc": "3.7.2",
"@salesforce/eslint-plugin-lightning": "1.0.1",
"@types/node": "^20.0.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/code-analyzer-flow-engine/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@salesforce/code-analyzer-flow-engine",
"description": "Plugin package that adds 'Flow Scanner' as an engine into Salesforce Code Analyzer",
"version": "0.32.0",
"version": "0.33.0-SNAPSHOT",
"author": "The Salesforce Code Analyzer Team",
"license": "BSD-3-Clause",
"homepage": "https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/overview",
Expand All @@ -13,7 +13,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"dependencies": {
"@salesforce/code-analyzer-engine-api": "0.33.0",
"@salesforce/code-analyzer-engine-api": "0.34.0-SNAPSHOT",
"@types/node": "^20.0.0",
"@types/semver": "^7.7.1",
"semver": "^7.7.3"
Expand All @@ -26,7 +26,7 @@
"rimraf": "^6.1.2",
"ts-jest": "^29.4.6",
"typescript": "^5.9.3",
"typescript-eslint": "^8.50.0"
"typescript-eslint": "^8.53.0"
},
"engines": {
"node": ">=20.0.0"
Expand Down
Loading