Skip to content

Commit

Permalink
Separate out plugin.js to avoid circular import
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanwilsonperkin committed Jul 23, 2024
1 parent 3294b3d commit 248ab1e
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 39 deletions.
37 changes: 2 additions & 35 deletions packages/eslint-plugin/index.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,6 @@
module.exports = {
rules: {
'binary-assignment-parens': require('./lib/rules/binary-assignment-parens'),
'class-property-semi': require('./lib/rules/class-property-semi'),
'images-no-direct-imports': require('./lib/rules/images-no-direct-imports'),
'jest-no-all-mocks-methods': require('./lib/rules/jest/no-all-mocks-methods'),
'jest-no-snapshots': require('./lib/rules/jest/no-snapshots'),
'jsx-no-complex-expressions': require('./lib/rules/jsx-no-complex-expressions'),
'jsx-no-hardcoded-content': require('./lib/rules/jsx-no-hardcoded-content'),
'jsx-prefer-fragment-wrappers': require('./lib/rules/jsx-prefer-fragment-wrappers'),
'no-ancestor-directory-import': require('./lib/rules/no-ancestor-directory-import'),
'no-debugger': require('./lib/rules/no-debugger'),
'no-namespace-imports': require('./lib/rules/no-namespace-imports'),
'no-useless-computed-properties': require('./lib/rules/no-useless-computed-properties'),
'no-fully-static-classes': require('./lib/rules/no-fully-static-classes'),
'polaris-prefer-sectioned-prop': require('./lib/rules/polaris-prefer-sectioned-prop'),
'polaris-no-bare-stack-item': require('./lib/rules/polaris-no-bare-stack-item'),
'prefer-class-properties': require('./lib/rules/prefer-class-properties'),
'prefer-early-return': require('./lib/rules/prefer-early-return'),
'prefer-module-scope-constants': require('./lib/rules/prefer-module-scope-constants'),
'prefer-twine': require('./lib/rules/prefer-twine'),
'react-hooks-strict-return': require('./lib/rules/react-hooks-strict-return'),
'react-initialize-state': require('./lib/rules/react-initialize-state'),
'react-no-multiple-render-methods': require('./lib/rules/react-no-multiple-render-methods'),
'react-prefer-private-members': require('./lib/rules/react-prefer-private-members'),
'react-require-autocomplete': require('./lib/rules/react-require-autocomplete'),
'react-type-state': require('./lib/rules/react-type-state'),
'restrict-full-import': require('./lib/rules/restrict-full-import'),
'sinon-no-restricted-features': require('./lib/rules/sinon-no-restricted-features'),
'sinon-prefer-meaningful-assertions': require('./lib/rules/sinon-prefer-meaningful-assertions'),
'strict-component-boundaries': require('./lib/rules/strict-component-boundaries'),
'typescript-prefer-pascal-case-enums': require('./lib/rules/typescript/prefer-pascal-case-enums'),
'typescript-prefer-singular-enums': require('./lib/rules/typescript/prefer-singular-enums'),
'typescript-prefer-build-client-schema': require('./lib/rules/typescript/prefer-build-client-schema'),
'webpack-no-unnamed-dynamic-imports': require('./lib/rules/webpack/no-unnamed-dynamic-imports'),
},
// Imported separately to allow configs to reference it and avoid circular reference
...require('./plugin'),

configs: {
// Core configs - When extending, one of these should go first
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/lib/config/core.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const eslintCommentsPlugin = require('eslint-plugin-eslint-comments');

const shopifyPlugin = require('../..');
const shopifyPlugin = require('../../plugin');

module.exports = [
{
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/lib/config/jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const globals = require('globals');
const jestPlugin = require('eslint-plugin-jest');
const jestFormattingPlugin = require('eslint-plugin-jest-formatting');

const shopifyPlugin = require('../..');
const shopifyPlugin = require('../../plugin');

module.exports = [
{
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/lib/config/polaris.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const shopifyPlugin = require('../..');
const shopifyPlugin = require('../../plugin');

module.exports = [
{
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/lib/config/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const reactPlugin = require('eslint-plugin-react');
const reactHooksPlugin = require('eslint-plugin-react-hooks');
const jsxA11yPlugin = require('eslint-plugin-jsx-a11y');

const shopifyPlugin = require('../..');
const shopifyPlugin = require('../../plugin');

module.exports = [
{
Expand Down
37 changes: 37 additions & 0 deletions packages/eslint-plugin/plugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
module.exports = {
rules: {
'binary-assignment-parens': require('./lib/rules/binary-assignment-parens'),
'class-property-semi': require('./lib/rules/class-property-semi'),
'images-no-direct-imports': require('./lib/rules/images-no-direct-imports'),
'jest-no-all-mocks-methods': require('./lib/rules/jest/no-all-mocks-methods'),
'jest-no-snapshots': require('./lib/rules/jest/no-snapshots'),
'jsx-no-complex-expressions': require('./lib/rules/jsx-no-complex-expressions'),
'jsx-no-hardcoded-content': require('./lib/rules/jsx-no-hardcoded-content'),
'jsx-prefer-fragment-wrappers': require('./lib/rules/jsx-prefer-fragment-wrappers'),
'no-ancestor-directory-import': require('./lib/rules/no-ancestor-directory-import'),
'no-debugger': require('./lib/rules/no-debugger'),
'no-namespace-imports': require('./lib/rules/no-namespace-imports'),
'no-useless-computed-properties': require('./lib/rules/no-useless-computed-properties'),
'no-fully-static-classes': require('./lib/rules/no-fully-static-classes'),
'polaris-prefer-sectioned-prop': require('./lib/rules/polaris-prefer-sectioned-prop'),
'polaris-no-bare-stack-item': require('./lib/rules/polaris-no-bare-stack-item'),
'prefer-class-properties': require('./lib/rules/prefer-class-properties'),
'prefer-early-return': require('./lib/rules/prefer-early-return'),
'prefer-module-scope-constants': require('./lib/rules/prefer-module-scope-constants'),
'prefer-twine': require('./lib/rules/prefer-twine'),
'react-hooks-strict-return': require('./lib/rules/react-hooks-strict-return'),
'react-initialize-state': require('./lib/rules/react-initialize-state'),
'react-no-multiple-render-methods': require('./lib/rules/react-no-multiple-render-methods'),
'react-prefer-private-members': require('./lib/rules/react-prefer-private-members'),
'react-require-autocomplete': require('./lib/rules/react-require-autocomplete'),
'react-type-state': require('./lib/rules/react-type-state'),
'restrict-full-import': require('./lib/rules/restrict-full-import'),
'sinon-no-restricted-features': require('./lib/rules/sinon-no-restricted-features'),
'sinon-prefer-meaningful-assertions': require('./lib/rules/sinon-prefer-meaningful-assertions'),
'strict-component-boundaries': require('./lib/rules/strict-component-boundaries'),
'typescript-prefer-pascal-case-enums': require('./lib/rules/typescript/prefer-pascal-case-enums'),
'typescript-prefer-singular-enums': require('./lib/rules/typescript/prefer-singular-enums'),
'typescript-prefer-build-client-schema': require('./lib/rules/typescript/prefer-build-client-schema'),
'webpack-no-unnamed-dynamic-imports': require('./lib/rules/webpack/no-unnamed-dynamic-imports'),
},
};

0 comments on commit 248ab1e

Please sign in to comment.