-
-
Notifications
You must be signed in to change notification settings - Fork 623
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(website): upgrade typescript eslint and parser manually (#2445)
* chore(website): upgrade eslint parser manually * chore(website): update test files to `.test.ts` * ci(website): simplify tests * ci(website): improve tests and its outputs
- Loading branch information
1 parent
db13468
commit a7aecaa
Showing
7 changed files
with
1,662 additions
and
1,575 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { EOL } from 'node:os'; | ||
import { listFiles, assert } from 'poku'; | ||
|
||
const invalidFiles: string[] = []; | ||
const message = [ | ||
'Invalid file types found in restricted directories.', | ||
'Please ensure that files in these directories have one of the following extensions:', | ||
]; | ||
|
||
const checkExtensions = ( | ||
dirs: string[], | ||
allowedExtensions: RegExp, | ||
ignoreList: RegExp = /\.DS_Store/ | ||
) => { | ||
dirs.forEach((dir) => { | ||
const files = listFiles(dir, { filter: /\./ }); | ||
|
||
files.forEach((file) => { | ||
if (!ignoreList.test(file) && !allowedExtensions.test(file)) { | ||
invalidFiles.push(file); | ||
message.push(`${EOL}${String(allowedExtensions)}`); | ||
message.push(`- ${file}`); | ||
} | ||
}); | ||
}); | ||
}; | ||
|
||
checkExtensions(['docs', 'i18n'], /\.(mdx|json)$/); | ||
checkExtensions(['helpers', 'plugins'], /\.ts$/); | ||
checkExtensions(['test/unit', 'test/utils'], /\.test\.ts$/); | ||
checkExtensions(['src/components', 'src/pages'], /\.tsx$/); | ||
checkExtensions(['src/css'], /\.scss$/); | ||
|
||
assert.deepStrictEqual( | ||
invalidFiles.length, | ||
0, | ||
Array.from(new Set(message)).join(EOL) | ||
); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.