Skip to content

Commit

Permalink
fix: pin godaddy eslint packages with eslint 8 compatability
Browse files Browse the repository at this point in the history
  • Loading branch information
agerard-godaddy committed Jan 22, 2025
1 parent 8a9a496 commit a3254bc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
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 a3254bc

Please sign in to comment.