Skip to content

eslint/rules/browser ​

Browser: the mode of a project's sources (a library, an application), after rules/node: browser globals, no Node module, imports of a neighbour or a folder without extension, devDependencies only in the files never shipped (specs, stories), no console output left behind.

7 rules, 7 on. Source: lint/eslint/rules/browser.mjs.

RuleSettingFilesWhat it checksWhy
import-x/no-anonymous-default-exportwarnsrc/**/*.ts—Warn: an anonymous default export has no name to search for; a tool may still require it.
import-x/no-default-exportwarnsrc/**/*.ts—Warn: named exports are easier to search and rename; a framework may still require a default export.
import-x/extensionserror, ["never",{"ignorePackages":true,"checkTypeImports":true}]src/**/*.ts—Custom: no extension in relative imports (./format-count): the bundler resolves it.
import-x/no-extraneous-dependencieserror, {"devDependencies":["**/*.spec.ts"],"optionalDependencies…src/**/*.ts—Custom: devDependencies only in the files never shipped.
import-x/no-nodejs-moduleserrorsrc/**/*.ts—Custom: the sources run in the browser.
local/import-folderserror, {"mode":"require"}src/**/*.ts—Custom: a relative import names a neighbour file or a folder (its index.ts), never a file of another folder.
no-consolewarnsrc/**/*.tsDisallow the use of consoleWarn: a debug trace left behind; a justified log (an error report) may stay.

Generated from the JSDoc of the sources.