Skip to content

JS-1836 Add rule for deprecated CSS keyword values#7206

Draft
erwan-leforestier-sonarsource wants to merge 1 commit into
masterfrom
feat/js-1836-declaration-property-value-keyword-no-deprecated
Draft

JS-1836 Add rule for deprecated CSS keyword values#7206
erwan-leforestier-sonarsource wants to merge 1 commit into
masterfrom
feat/js-1836-declaration-property-value-keyword-no-deprecated

Conversation

@erwan-leforestier-sonarsource
Copy link
Copy Markdown
Contributor

Summary

Add SonarJS support for stylelint's declaration-property-value-keyword-no-deprecated rule so deprecated CSS keyword values are reported as S8762. This also refreshes the generated CSS plugin metadata for the new rule.
RSPEC PR: https://github.com/SonarSource/rspec/pull/7024

Changes

  • register S8762 in the CSS rule metadata and generated plugin artifacts
  • expose the rule's ignoreKeywords parameter through the CSS rule-configuration transformer
  • cover the transformer, linter wrapper, and generated CSS plugin rule with tests

Functional Validation

Artifact: JS-1836-fv.zip

Once the file is attached to the PR description, unzip and run:
./run.sh

Expected output is in expected-output.txt. The README shows the
before/after comparison so you can reproduce the difference directly.

⚠️⚠️ This is not ready for review ⚠️⚠️

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 5, 2026

Agentic Analysis: Early Results

Agentic Analysis and Context Augmentation are available on your project. Here are some issues that could have been prevented. Follow the links to learn how to put them into action.

6 issue(s) found across 3 file(s):

Rule File Line Message
css:S4670 packages/analysis/tests/css/linter/fixtures/deprecated-keywords.css 3 Unexpected unknown type selector "c"
java:S1068 sonar-plugin/css/src/main/java/org/sonar/css/rules/S8762.java 47 Remove this unused "ignoreKeywords" private field.
java:S1130 sonar-plugin/css/src/test/java/org/sonar/css/rules/CssRuleTest.java 39 Remove the declaration of thrown exception 'java.lang.NoSuchMethodException', as it cannot be thrown from method's body.
java:S1130 sonar-plugin/css/src/test/java/org/sonar/css/rules/CssRuleTest.java 39 Remove the declaration of thrown exception 'java.lang.IllegalAccessException', as it cannot be thrown from method's body.
java:S1130 sonar-plugin/css/src/test/java/org/sonar/css/rules/CssRuleTest.java 39 Remove the declaration of thrown exception 'java.lang.reflect.InvocationTargetException', as it cannot be thrown from method's body.
java:S1130 sonar-plugin/css/src/test/java/org/sonar/css/rules/CssRuleTest.java 39 Remove the declaration of thrown exception 'java.lang.InstantiationException', as it cannot be thrown from method's body.

Analyzed by SonarQube Agentic Analysis in 2.3 s

@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented Jun 5, 2026

Code Review ✅ Approved

Implements rule S8762 to detect deprecated CSS keyword values, including configurable parameter support and updated plugin metadata. No issues found.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant