{ "extends": [ "plugin:@shopify/typescript", "plugin:@shopify/react", "plugin:@shopify/jest", "plugin:@shopify/node", "plugin:@shopify/polaris", "plugin:@shopify/prettier" ], "settings": { "react": { "version": "detect" } }, "rules": { "func-style": "off", "no-process-env": "off", "no-warning-comments": "off", "no-negated-condition": "off", "no-console": "error", "consistent-return": "off", "match-default-export-name": "off", "jsx-use-translation-function": "off", "lines-around-comment": [ "error", { "beforeBlockComment": false, "allowBlockStart": false } ], "babel/no-unused-expressions": "off", "import/named": "off", "import/no-default-export": ["error"], "react/button-has-type": "off", "react/no-array-index-key": "off", "react/jsx-fragments": ["error", "element"], "react/no-unsafe": ["error", {"checkAliases": true}], "react/jsx-uses-react": "off", "react/react-in-jsx-scope": "off", "@typescript-eslint/consistent-type-imports": "error", "@shopify/jsx-no-complex-expressions": "off", "@shopify/jsx-prefer-fragment-wrappers": "off", "import/no-useless-path-segments": "off", "@shopify/react-prefer-private-members": "off", "@typescript-eslint/array-type": ["error", {"defaultOption": "array"}], "@typescript-eslint/naming-convention": "off", "jsx-a11y/label-has-for": [ 2, { "required": { "some": ["nesting", "id"] }, "allowChildren": false } ], "jsx-a11y/no-autofocus": "off", "jsx-a11y/anchor-has-content": "off", "jsx-a11y/control-has-associated-label": "off", "jsx-a11y/role-supports-aria-props": "off", "jsx-a11y/mouse-events-have-key-events": "off", "jsx-a11y/click-events-have-key-events": "off", "jsx-a11y/no-noninteractive-element-interactions": "off", "jsx-a11y/no-noninteractive-element-to-interactive-role": "off", "no-restricted-imports": [ "error", { "paths": [ { "name": "test-utilities/legacy", "message": "Please import the modern testing library from 'test-utilities' instead" } ] } ], "camelcase": [ "error", { "allow": [ "UNSTABLE_colors", "UNSTABLE_cssCustomProperties", "UNSTABLE_telemetry" ] } ] }, "overrides": [ { "files": ["./packages/**/src/**/*.{ts,tsx}"], "excludedFiles": ["./packages/**/src/**/*.test.{ts,tsx}"], "extends": ["plugin:@shopify/typescript-type-checking"], "parserOptions": { "project": [ "./packages/polaris-viz/tsconfig.json", "./packages/polaris-viz-core/tsconfig.json" ] }, "rules": { "@typescript-eslint/prefer-readonly": "off", "@typescript-eslint/no-unnecessary-condition": "off", "@typescript-eslint/unbound-method": "off" } }, { "files": ["**/loom.config.ts", "sandbox/**/*"], "rules": { // We disable `import/no-extraneous-dependencies` for test files because it // would force releases of `@shopify/react-testing` (and similar devDependencies) // to cause unnecessary package bumps in every package that consumes them. // Test files with extraneous dependencies won't cause runtime errors in production. "import/no-extraneous-dependencies": "off", "no-use-before-define": "off", "@shopify/jsx-no-hardcoded-content": "off", "import/no-default-export": "off", "eslint-comments/no-unused-disable": "off", "react/prop-types": "off", "react/no-unescaped-entities": "off", "import/no-anonymous-default-export": "off", "no-console": "off", "id-length": "off", "@shopify/prefer-module-scope-constants": "off" } }, { "files": ["./packages/**/src/**/*.test.{ts,tsx}"], "rules": { "jest/no-truthy-falsy": "off", "@shopify/no-ancestor-directory-import": "off", "@shopify/jsx-no-hardcoded-content": "off", "jest/expect-expect": [ "error", { "assertFunctionNames": ["expect", "expectToThrow"] } ] } }, { "files": ["**/*.stories.{ts,tsx}"], "parserOptions": { "project": ["./tsconfig.json"] }, "rules": { "import/no-default-export": "off" } }, { "files": ["documentation/code/**/*.tsx"], "rules": { "react/no-unused-prop-types": "off", "@shopify/strict-component-boundaries": "off" } } ] }