diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..b9ad485 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,24 @@ +import { FlatCompat } from '@eslint/eslintrc'; +import js from '@eslint/js'; +import prettier from 'eslint-plugin-prettier'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all, +}); + +const config = [ + ...compat.extends('next/core-web-vitals', 'plugin:storybook/recommended'), + { + plugins: { + prettier, + }, + }, +]; + +export default config; diff --git a/package.json b/package.json index c7ba234..6c54fd7 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,8 @@ }, "devDependencies": { "@chromatic-com/storybook": "^3", + "@eslint/eslintrc": "^3.2.0", + "@eslint/js": "^9.16.0", "@storybook/addon-essentials": "^8.4.7", "@storybook/addon-interactions": "^8.4.7", "@storybook/addon-links": "^8.4.7", diff --git a/yarn.lock b/yarn.lock index ff37b21..c07c317 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1233,7 +1233,7 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@9.16.0": +"@eslint/js@9.16.0", "@eslint/js@^9.16.0": version "9.16.0" resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.16.0.tgz#3df2b2dd3b9163056616886c86e4082f45dbf3f4" integrity sha512-tw2HxzQkrbeuvyj1tG2Yqq+0H9wGoI2IMk4EOsQeX+vmd75FtJAzf+gTA69WF+baUKRYQ3x2kbLE08js5OsTVg==