chore(ws): added cspell to enforce spelling check
Signed-off-by: paulovmr <832830+paulovmr@users.noreply.github.com>
This commit is contained in:
parent
f90ee781ac
commit
0de0f8f833
|
|
@ -23,6 +23,7 @@ module.exports = {
|
||||||
'no-relative-import-paths',
|
'no-relative-import-paths',
|
||||||
'prettier',
|
'prettier',
|
||||||
'local-rules',
|
'local-rules',
|
||||||
|
'@cspell',
|
||||||
],
|
],
|
||||||
extends: [
|
extends: [
|
||||||
'eslint:recommended',
|
'eslint:recommended',
|
||||||
|
|
@ -233,6 +234,10 @@ module.exports = {
|
||||||
'func-names': 'warn',
|
'func-names': 'warn',
|
||||||
'local-rules/no-react-hook-namespace': 'error',
|
'local-rules/no-react-hook-namespace': 'error',
|
||||||
'local-rules/no-raw-react-router-hook': 'error',
|
'local-rules/no-raw-react-router-hook': 'error',
|
||||||
|
'@cspell/spellchecker': [
|
||||||
|
'error',
|
||||||
|
{ configFile: 'config/cspell.json', customWordListFile: 'config/cspell-ignore-words.txt' },
|
||||||
|
],
|
||||||
},
|
},
|
||||||
overrides: [
|
overrides: [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
scipy
|
||||||
|
kubeflow
|
||||||
|
mochawesome
|
||||||
|
jovyan
|
||||||
|
millicores
|
||||||
|
workspacekind
|
||||||
|
workspacekinds
|
||||||
|
healthcheck
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
/*
|
||||||
|
* Workaround suggested in https://github.com/streetsidesoftware/cspell/issues/3215
|
||||||
|
* while the fix for the library is in progress
|
||||||
|
*/
|
||||||
|
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Search for `package.json`
|
||||||
|
* @param {string} from - search `from` directory.
|
||||||
|
* @returns {string} - path to package.json
|
||||||
|
*/
|
||||||
|
function findNearestPackageJson(from) {
|
||||||
|
from = path.resolve(from);
|
||||||
|
const parent = path.dirname(from);
|
||||||
|
if (!from || parent === from) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const pkg = path.join(from, 'package.json');
|
||||||
|
if (fs.existsSync(pkg)) {
|
||||||
|
return pkg;
|
||||||
|
}
|
||||||
|
return findNearestPackageJson(parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load the nearest package.json
|
||||||
|
* @param {string} cwd
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
function loadPackage(cwd) {
|
||||||
|
const pkgFile = findNearestPackageJson(cwd);
|
||||||
|
if (!pkgFile) return;
|
||||||
|
return JSON.parse(fs.readFileSync(pkgFile, 'utf-8'));
|
||||||
|
}
|
||||||
|
|
||||||
|
function determinePackageNamesAndMethods(cwd = process.cwd()) {
|
||||||
|
const pkg = loadPackage(cwd) || {};
|
||||||
|
const packageNames = Object.keys(pkg.dependencies || {}).concat(
|
||||||
|
Object.keys(pkg.devDependencies || {}),
|
||||||
|
);
|
||||||
|
const setOfWords = new Set(packageNames.flatMap((name) => name.replace(/[@]/g, '').split('/')));
|
||||||
|
const words = [...setOfWords];
|
||||||
|
return { words };
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
words: determinePackageNamesAndMethods().words,
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"import": ["./cspell.config.cjs"]
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -32,11 +32,12 @@
|
||||||
"cypress:run:mock": "CY_MOCK=1 npm run cypress:run -- ",
|
"cypress:run:mock": "CY_MOCK=1 npm run cypress:run -- ",
|
||||||
"cypress:server:build": "POLL_INTERVAL=9999999 FAST_POLL_INTERVAL=9999999 npm run build",
|
"cypress:server:build": "POLL_INTERVAL=9999999 FAST_POLL_INTERVAL=9999999 npm run build",
|
||||||
"cypress:server": "serve ./dist -p 9001 -s -L",
|
"cypress:server": "serve ./dist -p 9001 -s -L",
|
||||||
"prettier": "prettier --ignore-path .gitignore --write \"**/*{.ts,.tsx,.js,.jsx,.css,.json}\"",
|
"prettier": "prettier --ignore-path .gitignore --write \"**/*{.ts,.tsx,.js,.cjs,.jsx,.css,.json}\"",
|
||||||
"prettier:check": "prettier --ignore-path .gitignore --check \"**/*{.ts,.tsx,.js,.jsx,.css,.json}\"",
|
"prettier:check": "prettier --ignore-path .gitignore --check \"**/*{.ts,.tsx,.js,.cjs,.jsx,.css,.json}\"",
|
||||||
"prepare": "cd ../../ && husky workspaces/frontend/.husky"
|
"prepare": "cd ../../ && husky workspaces/frontend/.husky"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@cspell/eslint-plugin": "^9.1.2",
|
||||||
"@cypress/code-coverage": "^3.13.5",
|
"@cypress/code-coverage": "^3.13.5",
|
||||||
"@mui/icons-material": "^6.3.1",
|
"@mui/icons-material": "^6.3.1",
|
||||||
"@mui/material": "^6.3.1",
|
"@mui/material": "^6.3.1",
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ export const EditableLabels: React.FC<EditableLabelsProps> = ({ rows, setRows })
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FormFieldGroupExpandable
|
<FormFieldGroupExpandable
|
||||||
className="form-label-fieldgroup"
|
className="form-label-field-group"
|
||||||
toggleAriaLabel="Labels"
|
toggleAriaLabel="Labels"
|
||||||
header={
|
header={
|
||||||
<FormFieldGroupHeader
|
<FormFieldGroupHeader
|
||||||
|
|
|
||||||
|
|
@ -184,7 +184,7 @@ export const WorkspaceKindFormResource: React.FC<WorkspaceKindFormResourceProps>
|
||||||
<FormFieldGroupHeader
|
<FormFieldGroupHeader
|
||||||
titleText={{
|
titleText={{
|
||||||
text: 'Resources',
|
text: 'Resources',
|
||||||
id: 'workspace-kind-podconfig-resource',
|
id: 'workspace-kind-pod-config-resource',
|
||||||
}}
|
}}
|
||||||
titleDescription={
|
titleDescription={
|
||||||
<>
|
<>
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ const NotFound: React.FunctionComponent = () => {
|
||||||
<PageSection>
|
<PageSection>
|
||||||
<EmptyState titleText="404 Page not found" variant="full" icon={ExclamationTriangleIcon}>
|
<EmptyState titleText="404 Page not found" variant="full" icon={ExclamationTriangleIcon}>
|
||||||
<EmptyStateBody>
|
<EmptyStateBody>
|
||||||
We didn't find a page that matches the address you navigated to.
|
We did not find a page that matches the address you navigated to.
|
||||||
</EmptyStateBody>
|
</EmptyStateBody>
|
||||||
<EmptyStateFooter>
|
<EmptyStateFooter>
|
||||||
<GoHomeBtn />
|
<GoHomeBtn />
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ const DeleteModal: React.FC<DeleteModalProps> = ({
|
||||||
{showWarning && (
|
{showWarning && (
|
||||||
<HelperText data-testid="delete-modal-helper-text">
|
<HelperText data-testid="delete-modal-helper-text">
|
||||||
<HelperTextItem icon={<ExclamationCircleIcon />} variant="error">
|
<HelperTextItem icon={<ExclamationCircleIcon />} variant="error">
|
||||||
The name doesn't match. Please enter exactly: {resourceName}
|
The name does not match. Please enter exactly: {resourceName}
|
||||||
</HelperTextItem>
|
</HelperTextItem>
|
||||||
</HelperText>
|
</HelperText>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -365,7 +365,7 @@ export const buildMockWorkspaceList = (args: {
|
||||||
current: {
|
current: {
|
||||||
id: podConfig.id,
|
id: podConfig.id,
|
||||||
displayName: podConfig.displayName,
|
displayName: podConfig.displayName,
|
||||||
description: `Pod with ${i}00 Milicores, ${i} GiB RAM`,
|
description: `Pod with ${i}00 Millicores, ${i} GiB RAM`,
|
||||||
labels: [
|
labels: [
|
||||||
{
|
{
|
||||||
key: 'cpu',
|
key: 'cpu',
|
||||||
|
|
|
||||||
|
|
@ -649,7 +649,7 @@
|
||||||
align-self: start;
|
align-self: start;
|
||||||
}
|
}
|
||||||
/* CSS workaround for spacing in labels in Workspace Kind */
|
/* CSS workaround for spacing in labels in Workspace Kind */
|
||||||
.form-label-fieldgroup .pf-v6-c-table tr:where(.pf-v6-c-table__tr) > :where(th, td) {
|
.form-label-field-group .pf-v6-c-table tr:where(.pf-v6-c-table__tr) > :where(th, td) {
|
||||||
padding-block-start: 0px;
|
padding-block-start: 0px;
|
||||||
}
|
}
|
||||||
/* CSS workaround to use MUI icon for sort icon */
|
/* CSS workaround to use MUI icon for sort icon */
|
||||||
|
|
|
||||||
|
|
@ -207,7 +207,7 @@ const useFetchState = <Type>(
|
||||||
return [doRequest(), unload];
|
return [doRequest(), unload];
|
||||||
}, [fetchCallbackPromise]);
|
}, [fetchCallbackPromise]);
|
||||||
|
|
||||||
// Use a memmo to update the `changePendingRef` immediately on change.
|
// Use a memo to update the `changePendingRef` immediately on change.
|
||||||
useMemo(() => {
|
useMemo(() => {
|
||||||
changePendingRef.current = true;
|
changePendingRef.current = true;
|
||||||
// React to changes to the `call` reference.
|
// React to changes to the `call` reference.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue