Skip to content

Commit

Permalink
Add cspell
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov committed May 12, 2023
1 parent 5d13c00 commit 32ca9cb
Show file tree
Hide file tree
Showing 8 changed files with 2,653 additions and 193 deletions.
42 changes: 42 additions & 0 deletions cspell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
language: en
useGitignore: true
ignorePaths:
# Excluded from spelling check
- cspell.yml
- package.json
dictionaries:
- fullstack

overrides:
- filename: '**/*.svg'
dictionaries:
- html
- fonts

- filename: 'README.md'
dictionaries:
- docker

words:
- DDTHH
- SFNS
- Graphi # GraphiQL
- SWAPI
- markselection
- foldmarker
- foldgutter
- guttermarker
- activeline
- lastline
- nargs
- keymap

- apisguru
# Upstream
- proxied
- proxying
- typeahead
- scrollbars
- subword
- graphiql
- iban
2,777 changes: 2,597 additions & 180 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
"node": ">= 12.x"
},
"scripts": {
"preversion": "npm ci --ignore-scripts && npm test",
"test": "npm run check && npm run prettier:check",
"test": "npm run check && npm run prettier:check && npm run check:spelling",
"check": "tsc --noEmit",
"start": "nodemon src/index.ts",
"debug": "ts-node --inspect --compilerOptions '{\"inlineSources\":true}' src/index.ts",
Expand All @@ -33,7 +32,8 @@
"copy:editor": "mkdir \"dist/editor\" && cp src/editor/*.html dist/editor && cp src/editor/*.js dist/editor && cp src/editor/*.css dist/editor && cp src/editor/*.svg dist/editor",
"build:all": "rm -rf dist && mkdir dist && npm run build:editor && npm run build:typescript && npm run copy:graphql && npm run copy:editor",
"prettier": "prettier --cache --cache-strategy metadata --ignore-path .gitignore --write --list-different .",
"prettier:check": "prettier --cache --cache-strategy metadata --ignore-path .gitignore --check ."
"prettier:check": "prettier --cache --cache-strategy metadata --ignore-path .gitignore --check .",
"check:spelling": "cspell --cache --no-progress '**/*'"
},
"dependencies": {
"body-parser": "1.19.0",
Expand All @@ -59,6 +59,7 @@
"classnames": "2.3.1",
"codemirror": "5.60.0",
"codemirror-graphql": "0.11.6",
"cspell": "6.31.1",
"css-loader": "3.5.3",
"graphiql": "0.17.5",
"marked": "1.1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/editor/GraphQLEditor/GraphQLEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export default class GraphQLEditor extends React.Component<GraphQLEditorProps> {
}

componentDidUpdate(prevProps) {
// Ensure the changes caused by this update are not interpretted as
// Ensure the changes caused by this update are not interpreted as
// user-input changes which could otherwise result in an infinite
// event loop.
this.ignoreChangeEvent = true;
Expand Down
2 changes: 1 addition & 1 deletion src/editor/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<title>GraphQL Faker</title>
</head>
<body>
<div id="container" clsss="app-container"></div>
<div id="container" class="app-container"></div>
<script src="main.js"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion src/fake_definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const fakeDefinitionAST = parse(/* GraphQL */ `
dbEngine
"""
By default returns dates beetween 2000-01-01 and 2030-01-01.
By default returns dates between 2000-01-01 and 2030-01-01.
Configure date format with options \`dateFormat\` \`dateFrom\` \`dateTo\`.
"""
date
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ parseCLI((options) => {
.then((schema) => {
const remoteSDL = new Source(
printSchema(schema),
`Inrospection from "${extendURL}"`,
`Introspection from "${extendURL}"`,
);

if (!userSDL) {
Expand Down Expand Up @@ -188,8 +188,8 @@ function prettyPrintValidationErrors(validationErrors: ValidationErrors) {
log(
chalk.red(
subErrors.length > 1
? `\nYour schema constains ${subErrors.length} validation errors: \n`
: `\nYour schema constains a validation error: \n`,
? `\nYour schema contains ${subErrors.length} validation errors: \n`
: `\nYour schema contains a validation error: \n`,
),
);

Expand Down
8 changes: 4 additions & 4 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ export function graphqlRequest(
query,
variables,
}),
}).then((responce) => {
if (responce.ok) return responce.json();
return responce.text().then((body) => {
throw Error(`${responce.status} ${responce.statusText}\n${body}`);
}).then((response) => {
if (response.ok) return response.json();
return response.text().then((body) => {
throw Error(`${response.status} ${response.statusText}\n${body}`);
});
});
}

0 comments on commit 32ca9cb

Please sign in to comment.