Skip to content

Instantly share code, notes, and snippets.

Created May 8, 2018
What would you like to do?
import json
with open('./foo.json') as df:
dump = json.load(df)
for f in dump:
fp = f['filePath']
rules = ', '.join(sorted(set(m['ruleId'] for m in f['messages'])))
if not rules:
with open(fp) as rf:
content =
with open(fp, 'w') as wf:
wf.write(f'/* eslint-disable {rules} */\n{content}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment