Skip to content

Latest commit

 

History

History
91 lines (64 loc) · 1.82 KB

README.md

File metadata and controls

91 lines (64 loc) · 1.82 KB

eslint

Configuration Notice

[email protected] requires a flat config format (see their migration guide) in order to run. Trunk will automatically detect which config file you have and by default will only enable a compatible version.

Ignores

Here is a conversion guide for ESLint-style ignores and trunk-ignores:

Same Line

alert("foo"); // trunk-ignore(eslint)

alert("foo"); // eslint-disable-line

Next Line

// trunk-ignore(eslint)
alert("foo");

/* eslint-disable-next-line */
alert("foo");

With Comments

// trunk-ignore(eslint): Expected alert
alert("foo");

/* eslint-disable-next-line -- Expected alert */
alert("foo");

Specific Issue

// trunk-ignore(eslint/no-alert)
alert("foo");

/* eslint-disable-next-line no-alert */
alert("foo");

Multiple Issues

// trunk-ignore(eslint/no-alert,eslint/quotes)
alert("foo");

/* eslint-disable-next-line no-alert, quotes */
alert("foo");

Blocks

// trunk-ignore-begin(eslint/no-alert)
alert("foo");
// trunk-ignore-end(eslint/no-alert)

/* eslint-disable no-alert */
alert("foo");
/* eslint-enable no-alert */

Whole File

// trunk-ignore-all(eslint/no-alert)
alert("foo");

/* eslint-disable no-alert */
alert("foo");

Notes

Only eslint-disable-line and eslint-disable-next-line support // comments. All other ESLint-style ignores must use /* */ comments. The full set of rules and their applicable files can be configured in an eslint config file.