Skip to content

Commit 19830cf

Browse files
committed
chore: cosmetic changes in the linter tools
1 parent 83b54f3 commit 19830cf

8 files changed

+20
-19
lines changed

.lintstagedrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export default {
2-
"*.{js,jsx,ts,tsx}": ["prettier --write", "eslint --fix"],
2+
"*.{js,ts,tsx}": ["prettier --write", "eslint --fix"],
33
"*.{less,css}": ["prettier --write", "stylelint --fix"],
44
};

eslint.config.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import ts from "typescript-eslint";
1313
import pkg from "./package.json" with { type: "json" };
1414

1515
export default [
16-
{ files: ["**/*.{js,mjs,cjs,jsx,ts,tsx}"] },
16+
{ files: ["**/*.{js,ts,tsx}"] },
1717
js.configs.recommended,
1818
...ts.configs.recommended,
1919
react.configs.flat.recommended,
@@ -125,7 +125,6 @@ export default [
125125
"**/tmp/",
126126
"root/",
127127
"packages/keybr-code/lib/parser.js",
128-
"*.cjs",
129128
],
130129
},
131130
];

package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,16 @@
1616
],
1717
"scripts": {
1818
"postinstall": "husky && patch-package",
19-
"check": "node scripts/config-lint.js && node scripts/gen-translations.js",
19+
"config-lint": "node scripts/config-lint.js",
20+
"translate": "node scripts/translate.js",
2021
"clean": "lage clean --no-cache",
2122
"compile": "lage compile --no-cache",
2223
"test": "lage test --no-cache",
23-
"lint": "eslint '{**/*,*}.{js,mjs,cjs,jsx,ts,tsx}'",
24-
"lint-fix": "eslint '{**/*,*}.{js,mjs,cjs,jsx,ts,tsx}' --fix",
24+
"lint": "eslint '{**/*,*}.{js,ts,tsx}'",
25+
"lint-fix": "eslint '{**/*,*}.{js,ts,tsx}' --fix",
2526
"stylelint": "stylelint '{**/*,*}.{less,css}'",
2627
"stylelint-fix": "stylelint '{**/*,*}.{less,css}' --fix",
27-
"format": "prettier '{**/*,*}.{js,mjs,cjs,jsx,ts,tsx,less,css}' --write",
28+
"format": "prettier '{**/*,*}.{js,ts,tsx,less,css}' --write",
2829
"build": "env NODE_ENV=production webpack",
2930
"build-dev": "env NODE_ENV=development webpack",
3031
"watch": "env NODE_ENV=development webpack --watch",

scripts/lib/key-order.js

-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ export const tsconfigJsonKeys = [
2626
[
2727
"rootDir",
2828
"outDir",
29-
"target",
30-
"module",
3129
"lib",
3230
"declaration",
3331
"declarationMap",

scripts/lib/lang-less.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { moduleName } from "./util.js";
1+
import { moduleName } from "./lang-util.js";
22

33
export function findLessDeps(fileName, source) {
44
const modules = new Set();

scripts/lib/lang-typescript.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import ts from "typescript";
2-
import { moduleName } from "./util.js";
2+
import { moduleName } from "./lang-util.js";
33

44
export function findTypescriptDeps(fileName, source) {
55
const modules = new Set();
File renamed without changes.

scripts/gen-translations.js scripts/translate.js

+11-8
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,19 @@ import { readJsonSync, writeJsonSync } from "./lib/fs.js";
66
import { getHashDigest } from "./lib/intl.js";
77
import { findPackages, rootDir } from "./root.js";
88

9-
const packageDir = join(rootDir, "packages/keybr-intl");
9+
const outputDir = join(rootDir, "packages", "keybr-intl");
10+
11+
const defaultLocale = "en";
1012

1113
const allLocales = [
14+
defaultLocale,
1215
"ar",
1316
"bg",
1417
"ca",
1518
"cs",
1619
"da",
1720
"de",
1821
"el",
19-
"en",
2022
"eo",
2123
"es",
2224
"et",
@@ -45,8 +47,6 @@ const allLocales = [
4547
"zh-hant",
4648
];
4749

48-
const defaultLocale = "en";
49-
5050
function findSourceFiles() {
5151
const files = [];
5252
for (const packageDirectory of findPackages()) {
@@ -189,7 +189,10 @@ async function writeReport(report) {
189189
}
190190
lines.push(``);
191191
}
192-
writeFileSync(join(rootDir, "docs/translations_report.md"), lines.join("\n"));
192+
writeFileSync(
193+
join(rootDir, "docs", "translations_report.md"),
194+
lines.join("\n"),
195+
);
193196
}
194197

195198
async function run() {
@@ -205,15 +208,15 @@ function remap(entries, callback) {
205208
}
206209

207210
function translationsPath(locale) {
208-
return join(packageDir, `translations`, `${locale}.json`);
211+
return join(outputDir, `translations`, `${locale}.json`);
209212
}
210213

211214
function mergedTranslationsPath(locale) {
212-
return join(packageDir, `translations`, `${locale}-merged.json`);
215+
return join(outputDir, `translations`, `${locale}-merged.json`);
213216
}
214217

215218
function messagesPath(locale) {
216-
return join(packageDir, `lib`, `messages`, `${locale}.json`);
219+
return join(outputDir, `lib`, `messages`, `${locale}.json`);
217220
}
218221

219222
run().catch((err) => {

0 commit comments

Comments
 (0)