Adding custom rules

Hello Team,

I’m using sonarqube 8.9v, I have a requirement to add custom rules for CSS and Javascript.
For javascript I found this issue:How to create custom rules for Javascript - #5 by Quentin wherein it was mentioned to create rules using ESLint and then import these rules using sonar.eslint.reportPaths.

I’m a newbie, Could you please guide me in more detail.

I have installed ESlint in vscode and have .eslintrc.js file generated. Which has the following content:
module.exports = {

‘env’: {

'browser': true,

'es2021': true,

'node': true,


‘extends’: [




‘parserOptions’: {

'ecmaVersion': 13,

'sourceType': 'module',


‘plugins’: [



‘rules’: {



Should I be adding rules under rules section, if yes then what should be my next step? Please advise.

Thanks in advance!!