From 0804f94169478ee42d0153a8e2c3b4636ee42673 Mon Sep 17 00:00:00 2001 From: Trish Rempel Date: Tue, 3 Sep 2024 15:16:23 -0500 Subject: [PATCH] Converted eslint config file --- .eslintignore | 12 --------- .eslintrc.js | 33 ------------------------ eslint.config.mjs | 64 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 45 deletions(-) delete mode 100644 .eslintignore delete mode 100644 .eslintrc.js create mode 100644 eslint.config.mjs diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 711addd0..00000000 --- a/.eslintignore +++ /dev/null @@ -1,12 +0,0 @@ -.dev/* -.github/* -.shadowenv.d/* -coverage/* -**/*.min.* -**/dist/* -**/node_modules/* - -/i18nextShopify.js -/i18nextShopify.min.js -/index.js -/index.d.ts diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 61d99358..00000000 --- a/.eslintrc.js +++ /dev/null @@ -1,33 +0,0 @@ -module.exports = { - env: { - browser: true, - es2021: true, - jest: true, - node: true, - }, - extends: [ - 'plugin:@shopify/jest', - 'plugin:@shopify/esnext', - 'plugin:@shopify/prettier', - 'plugin:testing-library/react', - 'plugin:jest-dom/recommended', - 'plugin:react/recommended', - ], - settings: { - react: { - version: 'detect', - }, - }, - overrides: [], - parserOptions: { - ecmaVersion: 'latest', - sourceType: 'module', - ecmaFeatures: { - jsx: true, - impliedStrict: true, - }, - }, - rules: { - '@babel/object-curly-spacing': 'off', - }, -}; diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 00000000..eee13006 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,64 @@ +import globals from "globals"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import js from "@eslint/js"; +import { FlatCompat } from "@eslint/eslintrc"; + +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 +}); + +export default [{ + ignores: [ + ".dev/*", + ".github/*", + ".shadowenv.d/*", + "coverage/*", + "**/*.min.*", + "**/dist/*", + "**/node_modules/*", + "i18nextShopify.js", + "i18nextShopify.min.js", + "index.js", + "index.d.ts", + ], +}, ...compat.extends( + "plugin:@shopify/jest", + "plugin:@shopify/esnext", + "plugin:@shopify/prettier", + "plugin:testing-library/react", + "plugin:jest-dom/recommended", + "plugin:react/recommended", +), { + languageOptions: { + globals: { + ...globals.browser, + ...globals.jest, + ...globals.node, + }, + + ecmaVersion: "latest", + sourceType: "module", + + parserOptions: { + ecmaFeatures: { + jsx: true, + impliedStrict: true, + }, + }, + }, + + settings: { + react: { + version: "detect", + }, + }, + + rules: { + "@babel/object-curly-spacing": "off", + }, +}]; \ No newline at end of file