{"id":25490,"library":"eslint-config-trendmicro","title":"eslint-config-trendmicro","description":"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.","status":"active","version":"4.4.1","language":"javascript","source_language":"en","source_url":"https://github.com/trendmicro-frontend/eslint-config-trendmicro","tags":["javascript","eslint","eslintconfig","config","trendmicro","styleguide"],"install":[{"cmd":"npm install eslint-config-trendmicro","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-config-trendmicro","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-config-trendmicro","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Provides stylistic rules like spacing, semicolons, and quotes","package":"@stylistic/eslint-plugin","optional":false},{"reason":"Core linting engine, peer dependency","package":"eslint","optional":false},{"reason":"Enforces import ordering and rules","package":"eslint-plugin-import","optional":false},{"reason":"Accessibility rules for JSX","package":"eslint-plugin-jsx-a11y","optional":false},{"reason":"React-specific linting rules","package":"eslint-plugin-react","optional":false},{"reason":"Rules for React hooks","package":"eslint-plugin-react-hooks","optional":false}],"imports":[{"note":"The default export is an array of ESLint flat config objects. CommonJS require is allowed via eslint.config.cjs, but ESM is recommended.","wrong":"const trendmicroConfig = require('eslint-config-trendmicro');","symbol":"default (trendmicroConfig)","correct":"import trendmicroConfig from 'eslint-config-trendmicro';"},{"note":"No named exports exist; only default export. Use default import.","wrong":"","symbol":"trendmicroConfig (named)","correct":"import { default as trendmicroConfig } from 'eslint-config-trendmicro';"},{"note":"Package does not export TypeScript types; use @types/eslint for type annotations.","wrong":"","symbol":"type (if needed)","correct":"import type { Linter } from 'eslint';"}],"quickstart":{"code":"// 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\n\n// eslint.config.mjs\nimport trendmicroConfig from 'eslint-config-trendmicro';\n\nexport default [\n  ...trendmicroConfig,\n  {\n    rules: {\n      'react/jsx-uses-react': 'off', // Not needed with React 17+\n      'react/react-in-jsx-scope': 'off', // Not needed with React 17+\n    },\n  },\n];","lang":"javascript","description":"Shows how to install peer dependencies and create an eslint.config.mjs with trendmicro config and custom rules."},"warnings":[{"fix":"Migrate to eslint.config.js using flat config. See README migration guide.","message":"v4.0.0 dropped support for ESLint v7/v8 and .eslintrc format. Only flat config (eslint.config.js) is supported.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Upgrade to v4+ and migrate to flat config, or stay on v3 if you must use .eslintrc.","message":"The version 3.x is deprecated and only maintained for legacy ESLint v7/v8 projects.","severity":"deprecated","affected_versions":">=3.0.0 <4.0.0"},{"fix":"Export [...trendmicroConfig, { ... }] instead of exporting trendmicroConfig directly.","message":"The default export is an array, not a single config object. Spreading (...) is required when adding custom configs.","severity":"gotcha","affected_versions":">=4.0.0"},{"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","message":"Peer dependencies must be installed manually. Running npm install --save-dev eslint-config-trendmicro does not install them automatically.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Create an additional config object after spreading trendmicroConfig and set languageOptions there.","message":"Custom 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.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"If using TypeScript, use @typescript-eslint/parser and configure parserOptions.project. For Babel, use @babel/eslint-parser.","message":"The 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.","severity":"gotcha","affected_versions":">=4.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Migrate to eslint.config.js and import trendmicroConfig as shown in the README.","cause":"Using .eslintrc with 'extends: \"trendmicro\"' which is unsupported in v4.","error":"Failed to load config \"trendmicro\" to extend from."},{"fix":"Run npm install --save-dev eslint-config-trendmicro@latest and ensure ESLint version is >=9.","cause":"Package not installed or version incompatible with ESLint.</s>","error":"Error: Cannot find module 'eslint-config-trendmicro'"},{"fix":"Use .mjs extension for ESM or .cjs for CommonJS, and ensure package.json has \"type\": \"module\" if using .js.","cause":"File extension mismatch or type field missing in package.json.","error":"Error: ESLint configuration is invalid: The value \"eslint.config.js\" cannot be used as a config file."},{"fix":"Install @babel/eslint-parser or @typescript-eslint/parser, and set parser in languageOptions.","cause":"Default ESLint parser cannot parse JSX. Need a JSX-compatible parser.","error":"Parsing error: Unexpected token <"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}