|
10 | 10 | 'black', 'flake8', 'mypy', 'eslint', 'csslint', 'fixmyjs', 'jshint', |
11 | 11 | 'prettier', |
12 | 12 | }) |
| 13 | +SYNCED_DEPENDENCIES = { |
| 14 | + '@eslint/js': 'eslint', |
| 15 | +} |
13 | 16 |
|
14 | 17 | _SEPS = ('==', '@') |
15 | 18 | _RE_SEP = re.compile(rf'^(.+)({"|".join(_SEPS)})(.+)$') |
@@ -74,16 +77,20 @@ def main(argv: Sequence[str] | None = None) -> int: |
74 | 77 | for i, dep in enumerate(hook.get('additional_dependencies', ())): |
75 | 78 | if match := _RE_SEP.match(dep): |
76 | 79 | name, sep, cur_version = match.groups() |
77 | | - target_version = versions.get(name, cur_version) |
| 80 | + target_version = versions.get( |
| 81 | + SYNCED_DEPENDENCIES.get(name, name), cur_version, |
| 82 | + ) |
78 | 83 | if target_version != cur_version: |
79 | 84 | updated_dep = f'{name}{sep}{target_version}' |
80 | 85 | hook['additional_dependencies'][i] = updated_dep |
81 | | - updated.append((hook['id'], name)) |
| 86 | + updated.append((hook['id'], dep, updated_dep)) |
82 | 87 |
|
83 | 88 | if updated: |
84 | 89 | print(f'Writing updates to {filename}:') |
85 | | - for hid, name in updated: |
86 | | - print(f'\tSetting {hid!r} dependency {name!r} to {versions[name]}') |
| 90 | + for hid, old_dep, updated_dep in updated: |
| 91 | + print( |
| 92 | + f'\tSetting {hid!r} dependency {old_dep!r} to {updated_dep!r}', |
| 93 | + ) |
87 | 94 |
|
88 | 95 | with open(filename, 'w+') as f: |
89 | 96 | yaml.dump(loaded, f) |
|
0 commit comments