Skip to content

Commit

Permalink
Pin GoDaddy ESLint packages with ESLint 8 compatability (#1019)
Browse files Browse the repository at this point in the history
* fix: pin godaddy eslint packages with eslint 8 compatability

* docs: changelog
  • Loading branch information
agerard-godaddy authored Jan 22, 2025
1 parent 8a9a496 commit 02f7623
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
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

0 comments on commit 02f7623

Please sign in to comment.