diff --git a/README.md b/README.md index f6a8bb4..0d3cd8c 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,19 @@ export default [ ] ``` +### React + Tailwind + +```js +// eslint.config.mjs + +import reactTailwind from 'eslint-config-nebula/react-tailwind' + +export default [ + ...reactTailwind, + // Override any settings from the "eslint-config-nebula" config here +] +``` + ### VS Code ```jsonc diff --git a/src/react-tailwind.d.ts b/src/react-tailwind.d.ts new file mode 100644 index 0000000..97c8c14 --- /dev/null +++ b/src/react-tailwind.d.ts @@ -0,0 +1,5 @@ +import type { Linter } from 'eslint' + +declare const reactTailwind: Linter.Config[] + +export = reactTailwind diff --git a/src/react-tailwind.mjs b/src/react-tailwind.mjs new file mode 100644 index 0000000..3419cd2 --- /dev/null +++ b/src/react-tailwind.mjs @@ -0,0 +1,5 @@ +import tailwind from 'eslint-plugin-tailwindcss' + +import react from './react.mjs' + +export default [...react, ...tailwind.configs['flat/recommended']] diff --git a/src/react.mjs b/src/react.mjs index 6dc778e..b79e75f 100644 --- a/src/react.mjs +++ b/src/react.mjs @@ -1,7 +1,6 @@ import react from 'eslint-plugin-react' import reactHooks from 'eslint-plugin-react-hooks' import reactRefresh from 'eslint-plugin-react-refresh' -import tailwind from 'eslint-plugin-tailwindcss' import globals from 'globals' import node from './node.mjs' @@ -15,7 +14,6 @@ export default [ }, react.configs.flat.recommended, react.configs.flat['jsx-runtime'], - ...tailwind.configs['flat/recommended'], { plugins: { 'react-hooks': reactHooks,