eslint/rules/modern-syntax
Modern syntax: Modern JavaScript: spread, at(), operator assignment, standard built-ins. Rules of ESLint, typescript-eslint and SonarJS (the Sonar way profile of SonarQube) on this subject, every rule listed; the TypeScript rules apply to TypeScript files only.
9 rules, 8 on. Source: lint/eslint/rules/modern-syntax.mjs.
| Rule | Setting | Files | What it checks | Why |
|---|---|---|---|---|
no-restricted-syntax | off | JS + TS | Disallow specified syntax | — |
no-sequences | warn | JS + TS | Disallow comma operators | — |
operator-assignment | error | JS + TS | Require or disallow assignment operator shorthand where possible | — |
prefer-spread | error | JS + TS | Require spread operators instead of .apply() | — |
symbol-description | error | JS + TS | Require symbol descriptions | — |
sonarjs/no-forced-browser-interaction | warn | JS + TS | Forced browser interactions should not bypass actionability checks | — |
sonarjs/prefer-default-last | warn | JS + TS | "default" clauses should be last | — |
@typescript-eslint/no-misused-new | error | TS | Enforce valid definition of new and constructor | — |
@typescript-eslint/no-misused-spread | error | TS | Disallow using the spread operator when it might cause unexpected behavior | — |