Skip to content

Commit acfd26a

Browse files
committed
Review cleanup
1 parent cfc70cf commit acfd26a

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

packages/code-analyzer-eslint-engine/src/base-config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ export class BaseConfigFactory {
110110
}
111111

112112
private createSldsConfigArray(): Linter.Config[] {
113-
//todo: Should this need to be updated now to take CSS into consideration?
114113
return sldsEslintPlugin.configs['flat/recommended'].map(conf => ({
115114
...conf,
116115
files: this.engineConfig.file_extensions.html.map(ext => `**/*${ext}`)

packages/code-analyzer-eslint-engine/src/rule-mappings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1602,7 +1602,7 @@ export const RULE_MAPPINGS: Record<string, {severity: SeverityLevel, tags: strin
16021602
// =================================================================================================================
16031603
"@salesforce-ux/slds/enforce-bem-usage": {
16041604
severity: SeverityLevel.Low,
1605-
tags: [COMMON_TAGS.RECOMMENDED, COMMON_TAGS.CATEGORIES.BEST_PRACTICES, COMMON_TAGS.LANGUAGES.HTML] //TODO: are there other tags?
1605+
tags: [COMMON_TAGS.RECOMMENDED, COMMON_TAGS.CATEGORIES.BEST_PRACTICES, COMMON_TAGS.LANGUAGES.HTML]
16061606
},
16071607
"@salesforce-ux/slds/modal-close-button-issue": {
16081608
severity: SeverityLevel.Moderate,

packages/code-analyzer-eslint-engine/test/plugin.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,17 @@ describe('Tests for the ESLintEnginePlugin', () => {
288288
'engines.eslint.file_extensions', '.js', '["javascript","typescript"]'));
289289
});
290290

291+
it('When a supported extension is listed under other language in file_extensions, then createEngineConfig errors', async () => {
292+
const userProvidedOverrides: ConfigObject = {
293+
file_extensions: {
294+
other: ['.html']
295+
}
296+
};
297+
await expect(callCreateEngineConfig(plugin, userProvidedOverrides)).rejects.toThrow(
298+
getMessage('InvalidFileExtensionDueToItBeingListedTwice',
299+
'engines.eslint.file_extensions', '.html', '["html","other"]'));
300+
});
301+
291302
it('When createEngine is passed an invalid engine name, then an error is thrown', async () => {
292303
await expect(plugin.createEngine('oops', DEFAULT_CONFIG)).rejects.toThrow(
293304
getMessage('UnsupportedEngineName' ,'oops'));

packages/code-analyzer-eslint-engine/test/test-data/workspaceWithFlatConfigMjs/eslint.config.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
export default [
22
{
33
rules: {
4-
"array-callback-return": ["error"],
54
"array-callback-return": ["error"],
65
"no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
76
"no-useless-backreference": ["warn"],

0 commit comments

Comments
 (0)