ESLint plugin that enforces the use of babel macros for specific libraries like styled-components and graphql-tag. Version 4.0.1, released as part of the frolint monorepo. Primarily used to automatically detect and correct imports from styled-components and graphql-tag to their macro equivalents. Differentiator: simple, focused rules for a common refactoring pattern; maintained by Wantedly.
npm install eslint-plugin-use-macrosVerified import paths — ran on the pinned version, not inferred.
Flat ESLint configuration that enables both styled-components and graphql-tag macro rules.
Use import syntax instead of require(). Ensure your project is configured to support ES modules.
List 'use-macros' first in the plugins array in flat config.
Use only 'error' or 'warn' as severity; do not pass options object.
Migrate to flat config as shown in the README.
npm install eslint-plugin-use-macros --save-dev and ensure it is listed in plugins array
Use dynamic import or switch to flat config with import
Remove options; rules only accept severity: 'error' or 'warn'