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

Pin GoDaddy ESLint packages with ESLint 8 compatability #1019

Merged
merged 2 commits into from
Jan 22, 2025
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
3 changes: 3 additions & 0 deletions packages/gasket-plugin-lint/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# `@gasket/plugin-lint`

- Pin GoDaddy ESLint packages with ESLint 8 compatability ([#1019])

### 7.1.0

- Aligned version releases across all packages
Expand Down Expand Up @@ -124,3 +126,4 @@
[#482]: https://github.com/godaddy/gasket/pull/482
[#670]: https://github.com/godaddy/gasket/pull/670
[#937]: https://github.com/godaddy/gasket/pull/937
[#1019]: https://github.com/godaddy/gasket/pull/1019
16 changes: 13 additions & 3 deletions packages/gasket-plugin-lint/lib/code-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,25 @@ const godaddy = {
configName = 'godaddy-flow';
}

// limit the supported version ranges
const versionRanges = {
'godaddy': '^7.1.1',
'godaddy-react': '^9.1.0',
'godaddy-flow': '^6.0.2',
'godaddy-react-flow': '^6.0.2',
'@godaddy/eslint-plugin-react-intl': '^1.3.0',
'stylelint-config-godaddy': '^0.6.0'
};

pkg.add(
'devDependencies',
await gatherDevDeps(`eslint-config-${configName}`)
await gatherDevDeps(`eslint-config-${configName}@${versionRanges[configName]}`)
);
pkg.add('eslintConfig', { extends: [configName] });

if (hasReactIntl) {
const pluginName = '@godaddy/eslint-plugin-react-intl';
const deps = await gatherDevDeps(pluginName);
const deps = await gatherDevDeps(`${pluginName}@${versionRanges[pluginName]}`);
// only add the plugin to avoid stomping config version
pkg.add('devDependencies', {
[pluginName]: deps[pluginName]
Expand All @@ -50,7 +60,7 @@ const godaddy = {

if (addStylelint) {
const stylelintName = 'stylelint-config-godaddy';
pkg.add('devDependencies', await gatherDevDeps(stylelintName));
pkg.add('devDependencies', await gatherDevDeps(`${stylelintName}@${versionRanges[stylelintName]}`));
pkg.add('stylelint', { extends: [stylelintName] });
}

Expand Down
3 changes: 2 additions & 1 deletion packages/gasket-plugin-lint/test/code-styles.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ describe('code styles', () => {
};
utils = {
gatherDevDeps: jest.fn().mockImplementation(dep => {
const depName = /^@?[^@]+/.exec(dep)[0];
return Promise.resolve({
[dep]: '*',
[depName]: '*',
example: 'latest'
});
}),
Expand Down
Loading