Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump @shopify/eslint-plugin from 44.0.0 to 46.0.0 #372

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .eslintignore

This file was deleted.

33 changes: 0 additions & 33 deletions .eslintrc.js

This file was deleted.

56 changes: 56 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import globals from 'globals';
import shopifyPlugin from '@shopify/eslint-plugin';

const config = [
{
ignores: [
'.dev/*',
'.github/*',
'.shadowenv.d/*',
'coverage/*',
'**/*.min.*',
'**/dist/*',
'**/node_modules/*',
'i18nextShopify.js',
'i18nextShopify.min.js',
'index.js',
'index.d.ts',
],
},
...shopifyPlugin.configs.core,
...shopifyPlugin.configs.esnext,
...shopifyPlugin.configs.jest,
...shopifyPlugin.configs.prettier,
...shopifyPlugin.configs.react,
{
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',
},
},
];

export default config;
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@changesets/get-release-plan": "^4.0.0",
"@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-node-resolve": "^15.0.2",
"@shopify/eslint-plugin": "^44.0.0",
"@shopify/eslint-plugin": "^46.0.0",
"@shopify/prettier-config": "^1.1.2",
"@testing-library/jest-dom": "^6.1.2",
"@testing-library/react": "^12.1.5",
Expand Down Expand Up @@ -80,5 +80,8 @@
"contributors": [],
"license": "MIT",
"lock": false,
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e",
"dependencies": {
"globals": "^15.9.0"
}
}
10 changes: 6 additions & 4 deletions test/shopify_format_with_react_i18next.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ describe('shopify format with react-i18next (t)', () => {

expect(
t('string_with_single_mustache', {
name: <strong>Joe</strong>,
name: <strong>{t('string')}</strong>,
}),
).toStrictEqual(
t('string_with_single_mustache', {name: expect.anything()}),
Expand Down Expand Up @@ -470,18 +470,20 @@ describe('with react-i18next (Trans with interpolation)', () => {
const count = 1;

return (
/* eslint-disable @shopify/jsx-no-hardcoded-content */
<Trans i18nKey="userMessagesUnread" count={count} values={{name}}>
Hello <strong title={t('nameTitle')}>{{name}}</strong>, you have{' '}
{{count}} unread message. <Link to="/msgs">Go to messages</Link>.
</Trans>
/* eslint-enable @shopify/jsx-no-hardcoded-content */
);
};

const {container} = render(<MyComponent />);
expect(container).toHaveTextContent(
'Hello Joe, you have 1 unread message. Go to message.',
);
expect(container).toMatchSnapshot();
expect(container).toMatchSnapshot(); // eslint-disable-line @shopify/jest-no-snapshots
});

it('handles interpolation of React components using Trans component with explicit component tags', () => {
Expand Down Expand Up @@ -511,7 +513,7 @@ describe('with react-i18next (Trans with interpolation)', () => {
expect(container).toHaveTextContent(
'Hello Joe, you have 1 unread message. Go to message.',
);
expect(container).toMatchSnapshot();
expect(container).toMatchSnapshot(); // eslint-disable-line @shopify/jest-no-snapshots
});

it('handles interpolation of React components using t() function with React components passed as interpolation variables', () => {
Expand Down Expand Up @@ -539,6 +541,6 @@ describe('with react-i18next (Trans with interpolation)', () => {
expect(container).toHaveTextContent(
'Hello Joe, you have 1 unread message. Go to message.',
);
expect(container).toMatchSnapshot();
expect(container).toMatchSnapshot(); // eslint-disable-line @shopify/jest-no-snapshots
});
});
4 changes: 2 additions & 2 deletions test/utils.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('Utils', () => {

expect(
replaceValue('Hello, {{name}}!', '{{name}}', span),
).toMatchSnapshot();
).toMatchSnapshot(); // eslint-disable-line @shopify/jest-no-snapshots
});

it('returns the original string when there is no match with given React elements', () => {
Expand All @@ -39,7 +39,7 @@ describe('Utils', () => {
span,
]);

expect(replaceValue(fragment, '{{name}}', 'John')).toMatchSnapshot();
expect(replaceValue(fragment, '{{name}}', 'John')).toMatchSnapshot(); // eslint-disable-line @shopify/jest-no-snapshots
});

it('replaces a string with a regular expression', () => {
Expand Down
Loading
Loading