-
Notifications
You must be signed in to change notification settings - Fork 20
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
Recursive option #13
Comments
Hi @benjaminaudet, apologies for the late reply. I won't really have any time to look at this in the near future, but happy to accept a PR for it if you want to have a go! |
I have a fairly janky solution to this @benjaminaudet. I'm not sure if it will help you, but I ran this command against the directories I wanted to recursively check: find ./ -type f That gave me a list of files, which I dropped into a text file. I then set up a new JS project and used this code to get the list: const fs = require('fs');
const I18nLint = require('i18n-lint');
try {
const data = fs.readFileSync('files_to_check.txt', 'utf8').split('\n');
let baseDir = 'the path to the top level dir I wanted to recursively check through'
data.forEach(file => {
const errors = I18nLint(baseDir + file, {
templateDelimiters: [['{{', '}}']], // I did this with a Vue repo
});
console.log(errors);
})
} catch (e) {
console.log('Error:', e.stack);
} It outputs like this, so maybe not 100% ideal but it's enough for me to know the scope of the issues: |
You can still use a glob pattern to match all files in a directory tree, I.E.:
If using inside a NPM script, don't forget to wrap the glob patter in quotation marks: |
Hey, I just discovered your tool, first of all, great job!
I think it could be cool to have a
-r, --recursive
option on the CLI to avoid that types of behavior :i18n-lint: ./components/base-components: is a directory
Thanks !
The text was updated successfully, but these errors were encountered: