Registry / testing / eslint-config-trendmicro

eslint-config-trendmicro

JSON →
library4.4.1jsnpmunverified

Trend Micro's official ESLint flat config, version 4.4.1, requiring Node >=20 and ESLint >=9. It provides a shareable configuration for React projects with support for JSX accessibility, import ordering, and custom parsers like Babel. Since v4.0.0, it uses the flat config format (eslint.config.js) exclusively, breaking compatibility with .eslintrc files used in v3.x. The config enforces strict stylistic rules via @stylistic/eslint-plugin and includes presets for React hooks. Peer dependencies include @stylistic/eslint-plugin, eslint-plugin-import, eslint-plugin-jsx-a11y, eslint-plugin-react, and eslint-plugin-react-hooks. Key differentiator: a maintained, opinionated config backed by Trend Micro's frontend team with regular patch and minor releases.

npm install eslint-config-trendmicro
INSTALL
IMPORT
SIG · ESLINT-CONFIG-TREN
E
eslint-config-trendmicro
testingjavascriptv4.4.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default (trendmicroConfig)
import trendmicroConfig from 'eslint-config-trendmicro';
const trendmicroConfig = require('eslint-config-trendmicro');
The default export is an array of ESLint flat config objects. CommonJS require is allowed via eslint.config.cjs, but ESM is recommended.
trendmicroConfig (named)
import { default as trendmicroConfig } from 'eslint-config-trendmicro';
No named exports exist; only default export. Use default import.
type (if needed)
import type { Linter } from 'eslint';
Package does not export TypeScript types; use @types/eslint for type annotations.

Shows how to install peer dependencies and create an eslint.config.mjs with trendmicro config and custom rules.

// Install: npm install --save-dev eslint-config-trendmicro eslint @stylistic/eslint-plugin eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-react-hooks // eslint.config.mjs import trendmicroConfig from 'eslint-config-trendmicro'; export default [ ...trendmicroConfig, { rules: { 'react/jsx-uses-react': 'off', // Not needed with React 17+ 'react/react-in-jsx-scope': 'off', // Not needed with React 17+ }, }, ];
Debug
Known issues
breakingv4.0.0 dropped support for ESLint v7/v8 and .eslintrc format. Only flat config (eslint.config.js) is supported.
fix
Migrate to eslint.config.js using flat config. See README migration guide.
affects: >=4.0.0
deprecatedThe version 3.x is deprecated and only maintained for legacy ESLint v7/v8 projects.
fix
Upgrade to v4+ and migrate to flat config, or stay on v3 if you must use .eslintrc.
affects: >=3.0.0 <4.0.0
gotchaThe default export is an array, not a single config object. Spreading (...) is required when adding custom configs.
fix
Export [...trendmicroConfig, { ... }] instead of exporting trendmicroConfig directly.
affects: >=4.0.0
gotchaPeer dependencies must be installed manually. Running npm install --save-dev eslint-config-trendmicro does not install them automatically.
fix
Install peer dependencies: npm install --save-dev eslint @stylistic/eslint-plugin eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-react-hooks
affects: >=4.0.0
gotchaCustom language options (like globals or parser) must be set in a separate config object, not inside the spread. Overriding languageOptions inside the imported array may be ignored.
fix
Create an additional config object after spreading trendmicroConfig and set languageOptions there.
affects: >=4.0.0
gotchaThe config enables React JSX rules, which require @babel/eslint-parser or similar for non-standard syntax. Using default ESLint parser may fail on JSX with TypeScript.
fix
If using TypeScript, use @typescript-eslint/parser and configure parserOptions.project. For Babel, use @babel/eslint-parser.
affects: >=4.0.0
Errors
Common errors & fixes
Failed to load config "trendmicro" to extend from.
Using .eslintrc with 'extends: "trendmicro"' which is unsupported in v4.
fix
Migrate to eslint.config.js and import trendmicroConfig as shown in the README.
Error: Cannot find module 'eslint-config-trendmicro'
Package not installed or version incompatible with ESLint.</s>
fix
Run npm install --save-dev eslint-config-trendmicro@latest and ensure ESLint version is >=9.
Error: ESLint configuration is invalid: The value "eslint.config.js" cannot be used as a config file.
File extension mismatch or type field missing in package.json.
fix
Use .mjs extension for ESM or .cjs for CommonJS, and ensure package.json has "type": "module" if using .js.
Parsing error: Unexpected token <
Default ESLint parser cannot parse JSX. Need a JSX-compatible parser.
fix
Install @babel/eslint-parser or @typescript-eslint/parser, and set parser in languageOptions.
Upgrade
Version history
4.4.1latest on npm
Audit
Dependencies
@stylistic/eslint-pluginrequiredProvides stylistic rules like spacing, semicolons, and quotes
eslintrequiredCore linting engine, peer dependency
eslint-plugin-importrequiredEnforces import ordering and rules
eslint-plugin-jsx-a11yrequiredAccessibility rules for JSX
eslint-plugin-reactrequiredReact-specific linting rules
eslint-plugin-react-hooksrequiredRules for React hooks
Agent activity
4 hits · last 30 days
node
4
Resources
eslint-config-trendmicro — npm install eslint-config-trendmicro · libregistry