Skip to content

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.

RuleSettingFilesWhat it checksWhy
no-restricted-syntaxoffJS + TSDisallow specified syntax—
no-sequenceswarnJS + TSDisallow comma operators—
operator-assignmenterrorJS + TSRequire or disallow assignment operator shorthand where possible—
prefer-spreaderrorJS + TSRequire spread operators instead of .apply()—
symbol-descriptionerrorJS + TSRequire symbol descriptions—
sonarjs/no-forced-browser-interactionwarnJS + TSForced browser interactions should not bypass actionability checks—
sonarjs/prefer-default-lastwarnJS + TS"default" clauses should be last—
@typescript-eslint/no-misused-newerrorTSEnforce valid definition of new and constructor—
@typescript-eslint/no-misused-spreaderrorTSDisallow using the spread operator when it might cause unexpected behavior—

Generated from the JSDoc of the sources.