Skip to content

Commit e87d4b4

Browse files
authored
feat: support ignoring with .intlifyignore or --ignore option (#52)
* feat: support ignoring with `.intlifyignore` or `--ignore` option closes #51 * fix: typo
1 parent f4b8018 commit e87d4b4

21 files changed

+379
-133
lines changed

.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = {
1414
'plugin:prettier/recommended',
1515
'prettier'
1616
],
17-
plugins: ['@typescript-eslint'],
17+
plugins: ['@typescript-eslint', 'mocha'],
1818
parserOptions: {
1919
parser: '@typescript-eslint/parser',
2020
sourceType: 'module'
@@ -30,6 +30,7 @@ module.exports = {
3030
}
3131
],
3232
rules: {
33+
'mocha/no-mocha-arrows': 'error',
3334
'object-curly-spacing': 'off',
3435
'@typescript-eslint/explicit-function-return-type': 'off',
3536
'@typescript-eslint/member-delimiter-style': 'off',

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,35 @@ Options:
4040
--version Show version number [boolean]
4141
```
4242

43+
## 🙈 Ignoring
44+
45+
For `annotate` or `format` commands, you can ignore with using `.intlifyignore` or `--ignore` for files passed at the end of the options or `--source` option
46+
47+
### `.intlifyignore`
48+
49+
To exclude files from iles passed at the end of the options or `--source` option, create a `.itnlifyignore` file in the root of your project. `.intlifyignore` uses [gitignore syntax](https://git-scm.com/docs/gitignore#_pattern_format).
50+
51+
example:
52+
```
53+
# Ignore node_modules
54+
node_modules
55+
56+
# ignore artifacts
57+
build
58+
coverage
59+
```
60+
61+
It’s recommended to have a `.intlifyignore` in your project! This way you can run `intlify format —source /path/to/**/*.vue —type custom-block` . to make sure that everything is executed (without mangling files you don’t want, or choking on generated files).
62+
63+
### `--ignore` option
64+
65+
If you can't use `.intlifyignore` for some reason and want to specify a different file, you can use the `--ignore` option to achieve this.
66+
67+
```sh
68+
# ignore with `.gitignore`
69+
intlify format —source /path/to/**/*.vue —type custom-block --ignore .gitignore
70+
```
71+
4372
## 🤝 API
4473

4574
About details, See the [API References](https://github.com/intlify/cli/blob/main/api.md)

locales/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"forced applying of attributes": "forced applying of attributes",
1616
"annotated result detail options": "annotated result detail options",
1717
"the attributes to annotate": "the attributes to annotate",
18+
"the ignore configuration path files passed at the end of the options or `--source` option": "The ignore configuration path files passed at the end of the options or `--source` option",
1819
"target files without annotating": "target files without annotating",
1920
"'--type' is not supported except for 'custom-block'": "'--type' is not supported except for 'custom-block'",
2021
"if you don't specify some files at the end of the command, the '—-source' option is required": "if you don't specify some files at the end of the command, the '—-source' option is required",

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"debug": "^4.3.2",
3737
"diff-match-patch": "^1.0.5",
3838
"fast-glob": "^3.2.7",
39+
"ignore": "^5.1.8",
3940
"jsonc-eslint-parser": "^1.4.1",
4041
"pathe": "^0.2.0",
4142
"prettier": "^2.4.1",
@@ -44,7 +45,7 @@
4445
"yargs": "^17.2.0"
4546
},
4647
"devDependencies": {
47-
"@intlify/eslint-plugin-vue-i18n": "^0.15.0",
48+
"@intlify/eslint-plugin-vue-i18n": "^1.0.0",
4849
"@kazupon/lerna-changelog": "^4.3.0",
4950
"@microsoft/api-extractor": "^7.18.2",
5051
"@secretlint/secretlint-rule-preset-recommend": "^3.3.0",
@@ -65,6 +66,7 @@
6566
"chai": "^4.3.4",
6667
"eslint": "^8.0.0",
6768
"eslint-config-prettier": "^8.3.0",
69+
"eslint-plugin-mocha": "^9.0.0",
6870
"eslint-plugin-prettier": "^4.0.0",
6971
"jiti": "^1.12.6",
7072
"lint-staged": "^11.0.0",

playground/ignore_targets/Foo.vue

Whitespace-only changes.

pnpm-lock.yaml

Lines changed: 66 additions & 74 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)