react-intl-lint 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/README.md +228 -0
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +5 -0
- package/dist/bin.js.map +1 -0
- package/dist/package.json +121 -0
- package/dist/src/cli/bin.d.ts +2 -0
- package/dist/src/cli/bin.js +7 -0
- package/dist/src/cli/bin.js.map +1 -0
- package/dist/src/cli/cli.d.ts +16 -0
- package/dist/src/cli/cli.js +174 -0
- package/dist/src/cli/cli.js.map +1 -0
- package/dist/src/cli/dictionaries/CliOptions.d.ts +3 -0
- package/dist/src/cli/dictionaries/CliOptions.js +158 -0
- package/dist/src/cli/dictionaries/CliOptions.js.map +1 -0
- package/dist/src/cli/dictionaries/index.d.ts +1 -0
- package/dist/src/cli/dictionaries/index.js +18 -0
- package/dist/src/cli/dictionaries/index.js.map +1 -0
- package/dist/src/cli/enums/OptionsNames.d.ts +29 -0
- package/dist/src/cli/enums/OptionsNames.js +36 -0
- package/dist/src/cli/enums/OptionsNames.js.map +1 -0
- package/dist/src/cli/enums/OptionsPath.d.ts +5 -0
- package/dist/src/cli/enums/OptionsPath.js +10 -0
- package/dist/src/cli/enums/OptionsPath.js.map +1 -0
- package/dist/src/cli/enums/index.d.ts +2 -0
- package/dist/src/cli/enums/index.js +19 -0
- package/dist/src/cli/enums/index.js.map +1 -0
- package/dist/src/cli/models/Option.d.ts +7 -0
- package/dist/src/cli/models/Option.js +36 -0
- package/dist/src/cli/models/Option.js.map +1 -0
- package/dist/src/cli/models/index.d.ts +1 -0
- package/dist/src/cli/models/index.js +18 -0
- package/dist/src/cli/models/index.js.map +1 -0
- package/dist/src/cli/utils/file.d.ts +3 -0
- package/dist/src/cli/utils/file.js +51 -0
- package/dist/src/cli/utils/file.js.map +1 -0
- package/dist/src/cli/utils/index.d.ts +1 -0
- package/dist/src/cli/utils/index.js +18 -0
- package/dist/src/cli/utils/index.js.map +1 -0
- package/dist/src/core/client.d.ts +16 -0
- package/dist/src/core/client.js +171 -0
- package/dist/src/core/client.js.map +1 -0
- package/dist/src/core/config.d.ts +3 -0
- package/dist/src/core/config.js +24 -0
- package/dist/src/core/config.js.map +1 -0
- package/dist/src/core/enums/ErrorFlow.d.ts +15 -0
- package/dist/src/core/enums/ErrorFlow.js +20 -0
- package/dist/src/core/enums/ErrorFlow.js.map +1 -0
- package/dist/src/core/enums/ErrorTypes.d.ts +6 -0
- package/dist/src/core/enums/ErrorTypes.js +11 -0
- package/dist/src/core/enums/ErrorTypes.js.map +1 -0
- package/dist/src/core/enums/StatusCodes.d.ts +6 -0
- package/dist/src/core/enums/StatusCodes.js +11 -0
- package/dist/src/core/enums/StatusCodes.js.map +1 -0
- package/dist/src/core/enums/ToggleRule.d.ts +5 -0
- package/dist/src/core/enums/ToggleRule.js +10 -0
- package/dist/src/core/enums/ToggleRule.js.map +1 -0
- package/dist/src/core/enums/index.d.ts +4 -0
- package/dist/src/core/enums/index.js +21 -0
- package/dist/src/core/enums/index.js.map +1 -0
- package/dist/src/core/index.d.ts +7 -0
- package/dist/src/core/index.js +24 -0
- package/dist/src/core/index.js.map +1 -0
- package/dist/src/core/interface/IAppConfig.d.ts +10 -0
- package/dist/src/core/interface/IAppConfig.js +3 -0
- package/dist/src/core/interface/IAppConfig.js.map +1 -0
- package/dist/src/core/interface/ILogger.d.ts +5 -0
- package/dist/src/core/interface/ILogger.js +3 -0
- package/dist/src/core/interface/ILogger.js.map +1 -0
- package/dist/src/core/interface/IMisprint.d.ts +6 -0
- package/dist/src/core/interface/IMisprint.js +3 -0
- package/dist/src/core/interface/IMisprint.js.map +1 -0
- package/dist/src/core/interface/IRule.d.ts +8 -0
- package/dist/src/core/interface/IRule.js +3 -0
- package/dist/src/core/interface/IRule.js.map +1 -0
- package/dist/src/core/interface/IRulesConfig.d.ts +14 -0
- package/dist/src/core/interface/IRulesConfig.js +3 -0
- package/dist/src/core/interface/IRulesConfig.js.map +1 -0
- package/dist/src/core/interface/IValidationMessage.d.ts +5 -0
- package/dist/src/core/interface/IValidationMessage.js +3 -0
- package/dist/src/core/interface/IValidationMessage.js.map +1 -0
- package/dist/src/core/interface/index.d.ts +6 -0
- package/dist/src/core/interface/index.js +23 -0
- package/dist/src/core/interface/index.js.map +1 -0
- package/dist/src/core/models/KeyModel.d.ts +8 -0
- package/dist/src/core/models/KeyModel.js +15 -0
- package/dist/src/core/models/KeyModel.js.map +1 -0
- package/dist/src/core/models/KeyModelWithLanguages.d.ts +18 -0
- package/dist/src/core/models/KeyModelWithLanguages.js +29 -0
- package/dist/src/core/models/KeyModelWithLanguages.js.map +1 -0
- package/dist/src/core/models/LanguagesModel.d.ts +7 -0
- package/dist/src/core/models/LanguagesModel.js +12 -0
- package/dist/src/core/models/LanguagesModel.js.map +1 -0
- package/dist/src/core/models/MisprintModel.d.ts +8 -0
- package/dist/src/core/models/MisprintModel.js +12 -0
- package/dist/src/core/models/MisprintModel.js.map +1 -0
- package/dist/src/core/models/StylishLogger.d.ts +11 -0
- package/dist/src/core/models/StylishLogger.js +37 -0
- package/dist/src/core/models/StylishLogger.js.map +1 -0
- package/dist/src/core/models/error/ErrorModel.d.ts +7 -0
- package/dist/src/core/models/error/ErrorModel.js +4 -0
- package/dist/src/core/models/error/ErrorModel.js.map +1 -0
- package/dist/src/core/models/error/FatalErrorModel.d.ts +7 -0
- package/dist/src/core/models/error/FatalErrorModel.js +16 -0
- package/dist/src/core/models/error/FatalErrorModel.js.map +1 -0
- package/dist/src/core/models/error/index.d.ts +2 -0
- package/dist/src/core/models/error/index.js +19 -0
- package/dist/src/core/models/error/index.js.map +1 -0
- package/dist/src/core/models/files/FileLanguageModel.d.ts +10 -0
- package/dist/src/core/models/files/FileLanguageModel.js +90 -0
- package/dist/src/core/models/files/FileLanguageModel.js.map +1 -0
- package/dist/src/core/models/files/FileModel.d.ts +12 -0
- package/dist/src/core/models/files/FileModel.js +44 -0
- package/dist/src/core/models/files/FileModel.js.map +1 -0
- package/dist/src/core/models/files/FileViewModel.d.ts +7 -0
- package/dist/src/core/models/files/FileViewModel.js +22 -0
- package/dist/src/core/models/files/FileViewModel.js.map +1 -0
- package/dist/src/core/models/files/index.d.ts +3 -0
- package/dist/src/core/models/files/index.js +20 -0
- package/dist/src/core/models/files/index.js.map +1 -0
- package/dist/src/core/models/index.d.ts +8 -0
- package/dist/src/core/models/index.js +25 -0
- package/dist/src/core/models/index.js.map +1 -0
- package/dist/src/core/models/results/ResultCliModel.d.ts +22 -0
- package/dist/src/core/models/results/ResultCliModel.js +84 -0
- package/dist/src/core/models/results/ResultCliModel.js.map +1 -0
- package/dist/src/core/models/results/ResultErrorModel.d.ts +13 -0
- package/dist/src/core/models/results/ResultErrorModel.js +43 -0
- package/dist/src/core/models/results/ResultErrorModel.js.map +1 -0
- package/dist/src/core/models/results/ResultFileModel.d.ts +11 -0
- package/dist/src/core/models/results/ResultFileModel.js +16 -0
- package/dist/src/core/models/results/ResultFileModel.js.map +1 -0
- package/dist/src/core/models/results/ResultModel.d.ts +15 -0
- package/dist/src/core/models/results/ResultModel.js +62 -0
- package/dist/src/core/models/results/ResultModel.js.map +1 -0
- package/dist/src/core/models/results/index.d.ts +4 -0
- package/dist/src/core/models/results/index.js +21 -0
- package/dist/src/core/models/results/index.js.map +1 -0
- package/dist/src/core/rules/AbsentViewKeysRule.d.ts +12 -0
- package/dist/src/core/rules/AbsentViewKeysRule.js +38 -0
- package/dist/src/core/rules/AbsentViewKeysRule.js.map +1 -0
- package/dist/src/core/rules/EmptyKeysRule.d.ts +10 -0
- package/dist/src/core/rules/EmptyKeysRule.js +25 -0
- package/dist/src/core/rules/EmptyKeysRule.js.map +1 -0
- package/dist/src/core/rules/MisprintRule.d.ts +12 -0
- package/dist/src/core/rules/MisprintRule.js +38 -0
- package/dist/src/core/rules/MisprintRule.js.map +1 -0
- package/dist/src/core/rules/ZombiesRule.d.ts +10 -0
- package/dist/src/core/rules/ZombiesRule.js +26 -0
- package/dist/src/core/rules/ZombiesRule.js.map +1 -0
- package/dist/src/core/rules/index.d.ts +4 -0
- package/dist/src/core/rules/index.js +21 -0
- package/dist/src/core/rules/index.js.map +1 -0
- package/dist/src/core/utils/index.d.ts +4 -0
- package/dist/src/core/utils/index.js +21 -0
- package/dist/src/core/utils/index.js.map +1 -0
- package/dist/src/core/utils/keys.d.ts +7 -0
- package/dist/src/core/utils/keys.js +40 -0
- package/dist/src/core/utils/keys.js.map +1 -0
- package/dist/src/core/utils/logger.d.ts +3 -0
- package/dist/src/core/utils/logger.js +13 -0
- package/dist/src/core/utils/logger.js.map +1 -0
- package/dist/src/core/utils/path.d.ts +5 -0
- package/dist/src/core/utils/path.js +56 -0
- package/dist/src/core/utils/path.js.map +1 -0
- package/dist/src/core/utils/shared.d.ts +2 -0
- package/dist/src/core/utils/shared.js +24 -0
- package/dist/src/core/utils/shared.js.map +1 -0
- package/package.json +121 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
# react-intl-lint
|
|
2
|
+
|
|
3
|
+
> Simple tools for check react-intl keys in whole app which use regexp.
|
|
4
|
+
|
|
5
|
+
[](https://github.com/semantic-release/semantic-release)
|
|
6
|
+
[](https://www.npmjs.com/package/react-intl-lint)
|
|
7
|
+
[](https://www.npmjs.com/package/react-intl-lint)
|
|
8
|
+
|
|
9
|
+
> for `react-intl` use [`react-intl-lint`]()
|
|
10
|
+
|
|
11
|
+
> for `ngx-translate` use [`ngx-translate-lint`]()
|
|
12
|
+
## Table of Contents
|
|
13
|
+
|
|
14
|
+
- [Background](#background)
|
|
15
|
+
- [Installation](#installation)
|
|
16
|
+
- [Usage](#usage)
|
|
17
|
+
- [CLI](#cli)
|
|
18
|
+
- [TypeScript](#TypeScript)
|
|
19
|
+
- [Contribute](#contribute)
|
|
20
|
+
- [Used By](#UsedBy)
|
|
21
|
+
- [License](#license)
|
|
22
|
+
|
|
23
|
+
## Background
|
|
24
|
+
|
|
25
|
+
There are a lot of translation [`react-intl`][react-intl] keys in the whole app.
|
|
26
|
+
This repository contains a proposal to check all translation keys in the whole app
|
|
27
|
+
which should exist in all languages files.
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
|
|
31
|
+
### NPM
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm install react-intl-lint -g
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### GitHub
|
|
38
|
+
|
|
39
|
+
The source code are available for download
|
|
40
|
+
at [GitHub Releases][github-release-url] and
|
|
41
|
+
[GitHub pages][github-pages-url] as well.
|
|
42
|
+
|
|
43
|
+
## Usage
|
|
44
|
+
|
|
45
|
+
### CLI
|
|
46
|
+
|
|
47
|
+
```text
|
|
48
|
+
|
|
49
|
+
Usage: react-intl-lint [options]
|
|
50
|
+
|
|
51
|
+
Simple CLI tools for check `react-intl` keys in app
|
|
52
|
+
|
|
53
|
+
Options:
|
|
54
|
+
-p, --project [glob] (required)
|
|
55
|
+
The path to project folder
|
|
56
|
+
Possible Values: <relative path|absolute path>
|
|
57
|
+
(default: "./src/**/*.{html,ts,js}")
|
|
58
|
+
-l, --languages [glob] (required)
|
|
59
|
+
The path to languages folder
|
|
60
|
+
Possible Values: <relative path|absolute path>
|
|
61
|
+
(default: "./src/assets/i18n/*.json")
|
|
62
|
+
-kv, --keysOnViews [enum]
|
|
63
|
+
Described how to handle the error of missing keys on view
|
|
64
|
+
Possible Values: <disable|warning|error>
|
|
65
|
+
(default: "error")
|
|
66
|
+
-zk, --zombieKeys [enum]
|
|
67
|
+
Described how to handle the error of zombies keys
|
|
68
|
+
Possible Values: <disable|warning|error>
|
|
69
|
+
(default: "warning")
|
|
70
|
+
-ek, --emptyKeys [enum]
|
|
71
|
+
Described how to handle empty value on translate keys
|
|
72
|
+
Possible Values: <disable|warning|error>
|
|
73
|
+
(default: "warning")
|
|
74
|
+
-i, --ignore [glob]
|
|
75
|
+
Ignore projects and languages files
|
|
76
|
+
Possible Values: <relative path|absolute path>
|
|
77
|
+
--maxWarning [glob]
|
|
78
|
+
Max count of warnings in all files. If this value more that count of warnings, then an error is return
|
|
79
|
+
Possible Values: <number>
|
|
80
|
+
(default: "0")
|
|
81
|
+
-mk, --misprintKeys [enum]
|
|
82
|
+
Try to find matches with misprint keys on views and languages keys. CCan be longer process!!
|
|
83
|
+
Possible Values: <disable|warning|error>
|
|
84
|
+
(default: "disable")
|
|
85
|
+
-ds, --deepSearch [enum]
|
|
86
|
+
Add each translate key to global regexp end try to find them on project. Can be longer process!!
|
|
87
|
+
Possible Values: <disable|enable>
|
|
88
|
+
(default: "disable")
|
|
89
|
+
-mc, --misprintCoefficient [number]
|
|
90
|
+
Coefficient for misprint option can be from 0 to 1.0.
|
|
91
|
+
(default: "0.9")
|
|
92
|
+
-c, --config [path]
|
|
93
|
+
Path to the config file.
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
-V, --version output the version number
|
|
97
|
+
-h, --help output usage information
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
Examples:
|
|
101
|
+
|
|
102
|
+
$ npx react-intl-lint -p ./src/app/**/*.{html,ts,js} -l ./src/assets/i18n/*.json
|
|
103
|
+
$ react-intl-lint -p ./src/app/**/*.{html,ts,js} -l ./src/assets/i18n/*.json
|
|
104
|
+
$ react-intl-lint -p ./src/app/**/*.{html,ts,js} -z disable -v error
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
> NOTE: For `project` and `languages` options need to include file types like on the example.
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
Default Config is:
|
|
111
|
+
```json
|
|
112
|
+
{
|
|
113
|
+
"rules": {
|
|
114
|
+
"keysOnViews": "error",
|
|
115
|
+
"zombieKeys": "warning",
|
|
116
|
+
"misprintKeys": "disable",
|
|
117
|
+
"deepSearch": "disable",
|
|
118
|
+
"emptyKeys": "warning",
|
|
119
|
+
"maxWarning": "0",
|
|
120
|
+
"misprintCoefficient": "0.9",
|
|
121
|
+
"ignoredKeys": [ "IGNORED.KEY.(.*)" ], // can be string or RegExp
|
|
122
|
+
"ignoredMisprintKeys": [],
|
|
123
|
+
"customRegExpToFindKeys": [ "(?<=marker\\(['\"])([A-Za-z0-9_\\-.]+)(?=['\"]\\))"], // to find: marker('TRSNLATE.KEY');
|
|
124
|
+
},
|
|
125
|
+
"project": "./src/app/**/*.{html,ts,js}",
|
|
126
|
+
"languages": "./src/assets/i18n/*.json"
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
#### How to write Custom RegExp
|
|
131
|
+
|
|
132
|
+
We have `(?<=marker\\(['\"])([A-Za-z0-9_\\-.]+)(?=['\"]\\))` RegExp witch contains of 3 parts:
|
|
133
|
+
|
|
134
|
+
- Prefix - `(?<=marker\\(['\"])`
|
|
135
|
+
- This construction tells that what we need matching before translate key
|
|
136
|
+
- start with `(?<=` and end `)`.
|
|
137
|
+
- `marker\\(['\"]` - tells that we try to find word `market` witch have on the second character `'`or `"`
|
|
138
|
+
- To summarize, we are trying to find keys before each word to be `market` and commas `'` or `"`
|
|
139
|
+
|
|
140
|
+
- Matching for key: `([A-Za-z0-9_\\-.]+)`
|
|
141
|
+
- This construction tells that we find and save all words which contain alphabet, numbers, and `_` or `-`.
|
|
142
|
+
- We recommend using this part of RegExp to find and save translated keys
|
|
143
|
+
- But you can also use `(.*)` If it's enough for your project
|
|
144
|
+
- Postfix - `(?=['\"]\\))` (the same as prefix, but need to be ended)
|
|
145
|
+
- This construction tells that what we need matching after translate key
|
|
146
|
+
- start with `(?=` and end `)`
|
|
147
|
+
- `['\"]\\)` - tells that we try to find word comas `'` or `"` and ended with `)`
|
|
148
|
+
- To summarize, we are trying to find keys ended each word to be commas `'` or `"` and `)`
|
|
149
|
+
|
|
150
|
+
Example RegExp will find following keys
|
|
151
|
+
- `marker('TRSNLATE.KEY')`
|
|
152
|
+
- `marker("TRSNLATE.KEY-2")`
|
|
153
|
+
|
|
154
|
+
#### Exit Codes
|
|
155
|
+
|
|
156
|
+
The CLI process may exit with the following codes:
|
|
157
|
+
|
|
158
|
+
- `0`: Linting succeeded without errors (warnings may have occurred)
|
|
159
|
+
- `1`: Linting failed with one or more rule violations with severity error
|
|
160
|
+
- `2`: An invalid command line argument or combination thereof was used
|
|
161
|
+
|
|
162
|
+
### TypeScript
|
|
163
|
+
|
|
164
|
+
```typescript
|
|
165
|
+
import { ToggleRule, ReactintlLint, IRulesConfig, ResultCliModel, ErrorTypes, LanguagesModel } from 'react-intl-lint';
|
|
166
|
+
|
|
167
|
+
const viewsPath: string = './src/app/**/*.{html,ts,js}';
|
|
168
|
+
const languagesPath: string = './src/assets/i18n/*.json';
|
|
169
|
+
const ignoredLanguagesPath: string = "./src/assets/i18n/ru.json, ./src/assets/i18n/ru-RU.json";
|
|
170
|
+
const ruleConfig: IRulesConfig = {
|
|
171
|
+
keysOnViews: ErrorTypes.error,
|
|
172
|
+
zombieKeys: ErrorTypes.warning,
|
|
173
|
+
misprintKeys: ErrorTypes.disable,
|
|
174
|
+
deepSearch: ToggleRule.disable,
|
|
175
|
+
emptyKeys: ErrorTypes.warning,
|
|
176
|
+
maxWarning: 0,
|
|
177
|
+
misprintCoefficient: 0.9,
|
|
178
|
+
ignoredKeys: [ 'EXAMPLE.KEY', 'IGNORED.KEY.(.*)' ], // can be string or RegExp
|
|
179
|
+
ignoredMisprintKeys: [],
|
|
180
|
+
customRegExpToFindKeys: [ "(?<=marker\\(['\"])([A-Za-z0-9_\\-.]+)(?=['\"]\\))" ] // to find: marker('TRSNLATE.KEY');
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
const reactIntlLint = new ReactIntlLint(viewsPath, languagesPath, ignoredLanguagesPath, ruleConfig)
|
|
184
|
+
const resultLint: ResultCliModel = reactIntlLint.lint(); // Run Lint
|
|
185
|
+
const languages: LanguagesModel[] = reactIntlLint.getLanguages() // Get Languages with all keys and views
|
|
186
|
+
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
#### NOTE!
|
|
190
|
+
If you have error `Can't resolve 'fs' in ...`. Please add next setting to you project:
|
|
191
|
+
|
|
192
|
+
- tsconfig.json
|
|
193
|
+
```json
|
|
194
|
+
{
|
|
195
|
+
"skipLibCheck": true
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## Contribute
|
|
200
|
+
|
|
201
|
+
You may contribute in several ways like requesting new features,
|
|
202
|
+
adding tests, fixing bugs, improving documentation or examples.
|
|
203
|
+
Please check our [contributing guidelines][contributing].
|
|
204
|
+
|
|
205
|
+
## Used By
|
|
206
|
+
|
|
207
|
+
Here can be your extensions
|
|
208
|
+
|
|
209
|
+
## License
|
|
210
|
+
|
|
211
|
+
[MIT][license-url]
|
|
212
|
+
|
|
213
|
+
[react-intl]: https://formatjs.io/docs/getting-started/installation/
|
|
214
|
+
[semantic-shield]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
|
|
215
|
+
[semantic-url]: https://github.com/semantic-release/semantic-release
|
|
216
|
+
[npm-shield]: https://img.shields.io/npm/v/svoboda-rabstvo/react-intl-lint.svg
|
|
217
|
+
[npm-url]: https://www.npmjs.com/package/react-intl-lint
|
|
218
|
+
[npm]: https://www.npmjs.com
|
|
219
|
+
[node-js]: https://nodejs.org
|
|
220
|
+
[github-shield]: https://img.shields.io/github/release/svoboda-rabstvo/react-intl-lint.svg?label=github
|
|
221
|
+
[github-url]: https://github.com/svoboda-rabstvo/react-intl-lint
|
|
222
|
+
[github-release-url]: https://github.com/svoboda-rabstvo/react-intl-lint/releases
|
|
223
|
+
[github-pages-url]: https://svoboda-rabstvo.github.io/react-intl-lint/
|
|
224
|
+
[schema-url]: http://json-schema.org/
|
|
225
|
+
[doc-url]: https://github.com/svoboda-rabstvo/react-intl-lint/blob/develop/doc
|
|
226
|
+
[license-url]: https://github.com/svoboda-rabstvo/react-intl-lint/blob/develop/LICENSE.md
|
|
227
|
+
[meta-url]: https://en.wikipedia.org/wiki/List_of_software_package_management_systems#Meta_package_managers
|
|
228
|
+
[contributing]: https://github.com/svoboda-rabstvo/react-intl-lint/blob/develop/.github/CONTRIBUTING.md
|
package/dist/bin.d.ts
ADDED
package/dist/bin.js
ADDED
package/dist/bin.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../bin.ts"],"names":[],"mappings":";;;AAEA,yBAAuB"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
{
|
|
2
|
+
"author": "Raman Lauryniuk <romanrostislavovich@gmail.com>",
|
|
3
|
+
"name": "react-intl-lint",
|
|
4
|
+
"version": "0.0.2",
|
|
5
|
+
"description": "Simple tools for check `react-intl` keys in app",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": "svoboda-rabstvo/react-intl-lint",
|
|
8
|
+
"bugs": "https://github.com/svoboda-rabstvo/react-intl-lint/issues",
|
|
9
|
+
"bin": {
|
|
10
|
+
"react-intl-lint": "dist/bin.js"
|
|
11
|
+
},
|
|
12
|
+
"main": "dist/src/core/index.js",
|
|
13
|
+
"scripts": {
|
|
14
|
+
"tsc": "./node_modules/.bin/tsc",
|
|
15
|
+
"markdownlint": "./node_modules/.bin/markdownlint",
|
|
16
|
+
"tslint": "./node_modules/.bin/tslint",
|
|
17
|
+
"doc:cli": "typedoc --mode modules --excludePrivate --excludeProtected --out ./docs/cli/ ./src/cli/",
|
|
18
|
+
"doc:core": "typedoc --mode modules --excludePrivate --excludeProtected --out ./docs/core/ ./src/core/",
|
|
19
|
+
"doc": "npm run doc:core && npm run doc:cli",
|
|
20
|
+
"lint:typescript": "tslint -c tslint.json --project . -t codeFrame",
|
|
21
|
+
"lint:markdown": "markdownlint --config ./config/markdownlint.json ./docs/**/*.md",
|
|
22
|
+
"test:unit": "nyc mocha -r ts-node/register ./test/unit/*.test.ts",
|
|
23
|
+
"test:integration": "mocha -r ts-node/register ./test/integration/*.test.ts",
|
|
24
|
+
"build": "tsc -p . && gulp -f ./config/gulp.js",
|
|
25
|
+
"lint": "npm run lint:typescript && npm run lint:markdown",
|
|
26
|
+
"test": "npm run test:integration",
|
|
27
|
+
"pre:release": "npm run lint && npm run build",
|
|
28
|
+
"semantic-release": "env-cmd semantic-release --no-ci",
|
|
29
|
+
"self-lint": "npx react-intl-lint -p ./test/integration/inputs/views/*.{html,ts,js} -l ./test/integration/inputs/locales/*.json -i ./test/integration/inputs/locales/incorrect.json"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist/",
|
|
33
|
+
"README.md"
|
|
34
|
+
],
|
|
35
|
+
"keywords": [
|
|
36
|
+
"react-intl",
|
|
37
|
+
"validator",
|
|
38
|
+
"linting",
|
|
39
|
+
"cli",
|
|
40
|
+
"react",
|
|
41
|
+
"validator",
|
|
42
|
+
"linter",
|
|
43
|
+
"lint",
|
|
44
|
+
"checker",
|
|
45
|
+
"translate"
|
|
46
|
+
],
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"registry": "https://registry.npmjs.org/",
|
|
49
|
+
"tag": "latest",
|
|
50
|
+
"access": "public"
|
|
51
|
+
},
|
|
52
|
+
"nyc": {
|
|
53
|
+
"check-coverage": true,
|
|
54
|
+
"lines": 70,
|
|
55
|
+
"statements": 70,
|
|
56
|
+
"functions": 70,
|
|
57
|
+
"branches": 70,
|
|
58
|
+
"extension": [
|
|
59
|
+
".ts",
|
|
60
|
+
".tsx"
|
|
61
|
+
],
|
|
62
|
+
"exclude": [
|
|
63
|
+
"coverage/**/*",
|
|
64
|
+
"test/**/*",
|
|
65
|
+
"dist/**/*",
|
|
66
|
+
"src/config.ts",
|
|
67
|
+
"index.ts",
|
|
68
|
+
"bin.ts"
|
|
69
|
+
],
|
|
70
|
+
"reporter": [
|
|
71
|
+
"html",
|
|
72
|
+
"text-summary"
|
|
73
|
+
],
|
|
74
|
+
"all": true,
|
|
75
|
+
"require": [
|
|
76
|
+
"ts-node/register"
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
"dependencies": {
|
|
80
|
+
"chalk": "^2.4.2",
|
|
81
|
+
"commander": "^2.20.0",
|
|
82
|
+
"conventional-cli": "^1.2.0",
|
|
83
|
+
"dir-glob": "^3.0.1",
|
|
84
|
+
"fs": "0.0.1-security",
|
|
85
|
+
"glob": "^7.1.4",
|
|
86
|
+
"lodash": "^4.17.20",
|
|
87
|
+
"ngast": "^0.6.2",
|
|
88
|
+
"path": "^0.12.7",
|
|
89
|
+
"rxjs": "^6.5.4",
|
|
90
|
+
"string-similarity": "^4.0.1",
|
|
91
|
+
"typescript": "^4.1.2"
|
|
92
|
+
},
|
|
93
|
+
"devDependencies": {
|
|
94
|
+
"@semantic-release/changelog": "^3.0.2",
|
|
95
|
+
"@semantic-release/git": "^7.0.8",
|
|
96
|
+
"@types/chai": "^4.1.7",
|
|
97
|
+
"@types/chalk": "^2.2.0",
|
|
98
|
+
"@types/commander": "^2.12.2",
|
|
99
|
+
"@types/dir-glob": "^2.0.0",
|
|
100
|
+
"@types/glob": "^7.1.1",
|
|
101
|
+
"@types/lodash": "^4.14.132",
|
|
102
|
+
"@types/mocha": "^5.2.6",
|
|
103
|
+
"@types/node": "^12.0.2",
|
|
104
|
+
"@types/sinon": "^7.0.11",
|
|
105
|
+
"@types/string-similarity": "^3.0.0",
|
|
106
|
+
"chai": "^4.2.0",
|
|
107
|
+
"env-cmd": "^10.1.0",
|
|
108
|
+
"gulp": "^4.0.2",
|
|
109
|
+
"gulp-copy": "^4.0.1",
|
|
110
|
+
"husky": "^2.3.0",
|
|
111
|
+
"markdownlint-cli": "^0.16.0",
|
|
112
|
+
"mocha": "^8.2.1",
|
|
113
|
+
"nyc": "^14.1.1",
|
|
114
|
+
"semantic-release": "^17.3.7",
|
|
115
|
+
"sinon": "^7.3.2",
|
|
116
|
+
"ts-node": "^10.6.0",
|
|
117
|
+
"tslint": "^5.11.0",
|
|
118
|
+
"typedoc": "^0.15.0",
|
|
119
|
+
"typescript": "^4.1.2"
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../../../src/cli/bin.ts"],"names":[],"mappings":";;;AAEA,+BAA4B;AAC5B,iDAA4C;AAE5C,SAAG,CAAC,GAAG,CAAC,yBAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { OptionModel } from './models';
|
|
3
|
+
import { ErrorTypes, ToggleRule } from "./../core";
|
|
4
|
+
declare class Cli {
|
|
5
|
+
private cliClient;
|
|
6
|
+
private cliOptions;
|
|
7
|
+
constructor(options: OptionModel[]);
|
|
8
|
+
static run(options: OptionModel[]): void;
|
|
9
|
+
init(options?: OptionModel[]): void;
|
|
10
|
+
runCli(): void;
|
|
11
|
+
parse(): void;
|
|
12
|
+
private validate;
|
|
13
|
+
runLint(project: string, languages: string, zombies?: ErrorTypes, views?: ErrorTypes, ignore?: string, maxWarning?: number, misprint?: ErrorTypes, emptyKeys?: ErrorTypes, deepSearch?: ToggleRule, misprintCoefficient?: number, ignoredKeys?: string[], ignoredMisprintKeys?: string[], customRegExpToFindKeys?: string[] | RegExp[], tsConfigPath?: string): void;
|
|
14
|
+
private printCurrentVersion;
|
|
15
|
+
}
|
|
16
|
+
export { Cli };
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.Cli = void 0;
|
|
8
|
+
const commander_1 = __importDefault(require("commander"));
|
|
9
|
+
const core_1 = require("./../core");
|
|
10
|
+
const config_1 = require("./../core/config");
|
|
11
|
+
const enums_1 = require("./enums");
|
|
12
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
13
|
+
const utils_1 = require("./utils");
|
|
14
|
+
const name = 'react-intl-lint';
|
|
15
|
+
// tslint:disable-next-line:no-any
|
|
16
|
+
const docs = {
|
|
17
|
+
name,
|
|
18
|
+
usage: '[options]',
|
|
19
|
+
description: 'Simple CLI tools for check `react-intl` keys in app',
|
|
20
|
+
examples: `
|
|
21
|
+
|
|
22
|
+
Examples:
|
|
23
|
+
|
|
24
|
+
$ ${name} -p ${config_1.config.defaultValues.projectPath} -l ${config_1.config.defaultValues.languagesPath}
|
|
25
|
+
$ ${name} -p ${config_1.config.defaultValues.projectPath} -z ${core_1.ErrorTypes.disable} -v ${core_1.ErrorTypes.error}
|
|
26
|
+
$ ${name} -p ${config_1.config.defaultValues.projectPath} -i ./src/assets/i18n/EN-us.json, ./src/app/app.*.{json}
|
|
27
|
+
|
|
28
|
+
`
|
|
29
|
+
};
|
|
30
|
+
class Cli {
|
|
31
|
+
constructor(options) {
|
|
32
|
+
this.cliClient = commander_1.default;
|
|
33
|
+
this.cliOptions = [];
|
|
34
|
+
this.cliOptions = options;
|
|
35
|
+
}
|
|
36
|
+
static run(options) {
|
|
37
|
+
const cli = new Cli(options);
|
|
38
|
+
cli.init();
|
|
39
|
+
cli.parse();
|
|
40
|
+
cli.runCli();
|
|
41
|
+
}
|
|
42
|
+
init(options = this.cliOptions) {
|
|
43
|
+
options.forEach((option) => {
|
|
44
|
+
const optionFlag = option.getFlag();
|
|
45
|
+
const optionDescription = option.getDescription();
|
|
46
|
+
const optionDefaultValue = option.default;
|
|
47
|
+
this.cliClient.option(optionFlag, optionDescription, optionDefaultValue);
|
|
48
|
+
});
|
|
49
|
+
// tslint:disable-next-line:no-any
|
|
50
|
+
const packageJson = (0, utils_1.parseJsonFile)((0, utils_1.getPackageJsonPath)());
|
|
51
|
+
this.cliClient.version(packageJson.version);
|
|
52
|
+
this.cliClient
|
|
53
|
+
.name(docs.name)
|
|
54
|
+
.usage(docs.usage)
|
|
55
|
+
.description(docs.description)
|
|
56
|
+
.on(`--${enums_1.OptionsLongNames.help}`, () => {
|
|
57
|
+
// tslint:disable-next-line:no-console
|
|
58
|
+
console.log(docs.examples);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
runCli() {
|
|
62
|
+
try {
|
|
63
|
+
// tslint:disable-next-line:no-any
|
|
64
|
+
const options = this.cliClient.config ? (0, utils_1.parseJsonFile)(this.cliClient.config) : this.cliClient;
|
|
65
|
+
const projectPath = options.project;
|
|
66
|
+
const languagePath = options.languages;
|
|
67
|
+
const tsConfigPath = options.tsConfigPath;
|
|
68
|
+
let deepSearch;
|
|
69
|
+
let optionIgnore;
|
|
70
|
+
let optionMisprint;
|
|
71
|
+
let optionEmptyKey;
|
|
72
|
+
let optionViewsRule;
|
|
73
|
+
let optionMaxWarning;
|
|
74
|
+
let optionZombiesRule;
|
|
75
|
+
let optionIgnoredKeys;
|
|
76
|
+
let optionMisprintCoefficient;
|
|
77
|
+
let optionIgnoredMisprintKeys;
|
|
78
|
+
let optionCustomRegExpToFindKeys;
|
|
79
|
+
if (!!options.rules) {
|
|
80
|
+
deepSearch = options.rules.deepSearch;
|
|
81
|
+
optionIgnore = options.rules.ignore;
|
|
82
|
+
optionMisprint = options.rules.misprintKeys;
|
|
83
|
+
optionEmptyKey = options.rules.emptyKeys;
|
|
84
|
+
optionViewsRule = options.rules.keysOnViews;
|
|
85
|
+
optionMaxWarning = options.rules.maxWarning;
|
|
86
|
+
optionZombiesRule = options.rules.zombieKeys;
|
|
87
|
+
optionIgnoredKeys = options.rules.ignoredKeys;
|
|
88
|
+
optionMisprintCoefficient = options.rules.misprintCoefficient;
|
|
89
|
+
optionIgnoredMisprintKeys = options.rules.ignoredMisprintKeys;
|
|
90
|
+
optionCustomRegExpToFindKeys = options.rules.customRegExpToFindKeys;
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
deepSearch = options.deepSearch;
|
|
94
|
+
optionIgnore = options.ignore;
|
|
95
|
+
optionMisprint = options.misprintKeys;
|
|
96
|
+
optionEmptyKey = options.emptyKeys;
|
|
97
|
+
optionViewsRule = options.keysOnViews;
|
|
98
|
+
optionMaxWarning = options.maxWarning;
|
|
99
|
+
optionZombiesRule = options.zombieKeys;
|
|
100
|
+
optionIgnoredKeys = options.ignoredKeys;
|
|
101
|
+
optionMisprintCoefficient = options.misprintCoefficient;
|
|
102
|
+
optionIgnoredMisprintKeys = options.ignoredMisprintKeys;
|
|
103
|
+
optionCustomRegExpToFindKeys = options.customRegExpToFindKeys;
|
|
104
|
+
}
|
|
105
|
+
this.printCurrentVersion();
|
|
106
|
+
if (options.project && options.languages) {
|
|
107
|
+
this.runLint(projectPath, languagePath, optionZombiesRule, optionViewsRule, optionIgnore, optionMaxWarning, optionMisprint, optionEmptyKey, deepSearch, optionMisprintCoefficient, optionIgnoredKeys, optionIgnoredMisprintKeys, optionCustomRegExpToFindKeys, tsConfigPath);
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
const cliHasError = this.validate();
|
|
111
|
+
if (cliHasError) {
|
|
112
|
+
process.exit(core_1.StatusCodes.crash);
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
this.cliClient.help();
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
// tslint:disable-next-line: no-console
|
|
121
|
+
console.error(error);
|
|
122
|
+
process.exitCode = core_1.StatusCodes.crash;
|
|
123
|
+
}
|
|
124
|
+
finally {
|
|
125
|
+
process.exit();
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
parse() {
|
|
129
|
+
this.cliClient.parse(process.argv);
|
|
130
|
+
}
|
|
131
|
+
validate() {
|
|
132
|
+
const requiredOptions = this.cliOptions.filter((option) => option.required);
|
|
133
|
+
const missingRequiredOption = requiredOptions.reduce((accum, option) => {
|
|
134
|
+
if (!this.cliClient[String(option.longName)]) {
|
|
135
|
+
accum = false;
|
|
136
|
+
// tslint:disable-next-line: no-console
|
|
137
|
+
console.error(`Missing required argument: ${option.getFlag()}`);
|
|
138
|
+
}
|
|
139
|
+
return accum;
|
|
140
|
+
}, false);
|
|
141
|
+
return missingRequiredOption;
|
|
142
|
+
}
|
|
143
|
+
runLint(project, languages, zombies, views, ignore, maxWarning = 1, misprint, emptyKeys, deepSearch, misprintCoefficient = 0.9, ignoredKeys = [], ignoredMisprintKeys = [], customRegExpToFindKeys = [], tsConfigPath) {
|
|
144
|
+
const errorConfig = {
|
|
145
|
+
misprintKeys: misprint || core_1.ErrorTypes.disable,
|
|
146
|
+
deepSearch: deepSearch || core_1.ToggleRule.disable,
|
|
147
|
+
zombieKeys: zombies || core_1.ErrorTypes.warning,
|
|
148
|
+
emptyKeys: emptyKeys || core_1.ErrorTypes.warning,
|
|
149
|
+
keysOnViews: views || core_1.ErrorTypes.error,
|
|
150
|
+
maxWarning,
|
|
151
|
+
ignoredKeys,
|
|
152
|
+
ignoredMisprintKeys,
|
|
153
|
+
misprintCoefficient,
|
|
154
|
+
customRegExpToFindKeys,
|
|
155
|
+
};
|
|
156
|
+
const validationModel = new core_1.ReactIntlLint(project, languages, ignore, errorConfig, tsConfigPath);
|
|
157
|
+
const resultCliModel = validationModel.lint(maxWarning);
|
|
158
|
+
const resultModel = resultCliModel.getResultModel();
|
|
159
|
+
resultModel.printResult();
|
|
160
|
+
resultModel.printSummery();
|
|
161
|
+
process.exitCode = resultCliModel.exitCode();
|
|
162
|
+
if (resultModel.hasError) {
|
|
163
|
+
throw new core_1.FatalErrorModel(chalk_1.default.red(resultModel.message));
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
printCurrentVersion() {
|
|
167
|
+
// tslint:disable-next-line:no-any
|
|
168
|
+
const packageJson = (0, utils_1.parseJsonFile)((0, utils_1.getPackageJsonPath)());
|
|
169
|
+
// tslint:disable-next-line:no-console
|
|
170
|
+
console.log(`Current version: ${packageJson.version}`);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
exports.Cli = Cli;
|
|
174
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/cli/cli.ts"],"names":[],"mappings":";;;;;;;AACA,0DAAkC;AAGlC,oCASmB;AAEnB,6CAA0C;AAC1C,mCAA8D;AAC9D,kDAA0B;AAC1B,mCAA4D;AAE5D,MAAM,IAAI,GAAW,iBAAiB,CAAC;AAEvC,kCAAkC;AAClC,MAAM,IAAI,GAAQ;IACd,IAAI;IACJ,KAAK,EAAE,WAAW;IAClB,WAAW,EAAE,qDAAqD;IAClE,QA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