Skip to content

Commit

Permalink
chore: Add cspell
Browse files Browse the repository at this point in the history
  • Loading branch information
javierbrea committed Dec 6, 2024
1 parent d5da8bd commit d05a3f2
Show file tree
Hide file tree
Showing 15 changed files with 796 additions and 33 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ jobs:
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
- name: Install dependencies
run: pnpm install
- name: Check spelling
run: pnpm run cspell
- name: Lint
run: pnpm run lint
- name: Check types
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ Use `cy.saveLocalStorage()` to save a snapshot of current `localStorage` at the

#### Cookies button example

Next example shows how this package can be used to test a "cookies button" _(which theorically sets a flag into `localStorage` and can be clicked only once)_
Next example shows how this package can be used to test a "cookies button" _(which in theory sets a flag into `localStorage` and can be clicked only once)_

```js
describe("Accept cookies button", () => {
Expand Down
47 changes: 47 additions & 0 deletions cspell.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
const { resolve } = require("path");

const DICTIONARIES_BASE_PATH = resolve(__dirname, "cspell");

module.exports = {
// Version of the setting file. Always 0.2
version: "0.2",
// Paths to be ignored
ignorePaths: [
"**/node_modules/**",
".husky/**",
"**/pnpm-lock.yaml",
"**/cspell/*.txt",
"cspell.config.js",
"**/.gitignore",
"**/coverage/**",
"**/dist/**",
"test-e2e/app/build/**",
"test-e2e/*/cypress/integration/**",
"test-e2e/app/build/**",
"test-e2e/cypress-typescript/cypress/support/cypress-localstorage-commands/**",
"reports/**",
],
caseSensitive: false,
// Language - current active spelling language
language: "en",
// Dictionaries to be used
dictionaryDefinitions: [
{
name: "missing",
path: `${DICTIONARIES_BASE_PATH}/missing.txt`,
},
],
dictionaries: ["missing"],
languageSettings: [
{
// In markdown files
languageId: "markdown",
// Exclude code blocks from spell checking
ignoreRegExpList: ["/^\\s*```[\\s\\S]*?^\\s*```/gm"],
},
],
// The minimum length of a word before it is checked.
minWordLength: 4,
// cspell:disable-next-line FlagWords - list of words to be always considered incorrect. This is useful for offensive words and common spelling errors. For example "hte" should be "the"
flagWords: ["hte"],
};
6 changes: 6 additions & 0 deletions cspell/missing.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Brea
commonmark
javierbrea
prelint
Uninen

1 change: 1 addition & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default [
"test-e2e/*/cypress/integration/**",
"test-e2e/app/build/**",
"test-e2e/cypress-typescript/cypress/support/cypress-localstorage-commands/**",
"reports/**",
],
},
{
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,19 @@
"main": "index.js",
"types": "index.d.ts",
"scripts": {
"cspell": "cspell . --quiet",
"lint": "eslint .",
"lint-staged": "lint-staged",
"test": "jest",
"test:ci": "pnpm run test:unit && pnpm run test:mutation && pnpm run test:e2e",
"test:e2e": "pnpm test:e2e:cypress-9 && pnpm test:e2e:cypress-9-no-plugin && pnpm test:e2e:cypress-latest && pnpm test:e2e:cypress-latest-no-plugin && pnpm test:e2e:cypress-typescript",
"test:e2e:cypress-9": "pnpm --filter cypress-9 test:ci",
"test:e2e:cypress-9-no-plugin": "pnpm --filter cypress-9-no-plugin test:ci",
"test:e2e:cypress-latest": "pnpm --filter cypress-latest test:ci",
"test:e2e:cypress-latest-no-plugin": "pnpm --filter cypress-latest-no-plugin test:ci",
"test:e2e:cypress-typescript": "pnpm --filter cypress-typescript test:ci",
"test:e2e": "pnpm test:e2e:cypress-9 && pnpm test:e2e:cypress-9-no-plugin && pnpm test:e2e:cypress-latest && pnpm test:e2e:cypress-latest-no-plugin && pnpm test:e2e:cypress-typescript",
"test:unit": "pnpm run test",
"test:mutation": "stryker run",
"test:ci": "pnpm run test:unit && pnpm run test:mutation && pnpm run test:e2e",
"test:unit": "pnpm run test",
"tsc": "tsc",
"prepare": "is-ci || husky install"
},
Expand All @@ -55,6 +56,7 @@
"@typescript-eslint/parser": "8.17.0",
"babel-loader": "9.2.1",
"babel-plugin-module-resolver": "5.0.2",
"cspell": "8.16.1",
"cypress": "13.16.1",
"eslint": "9.16.0",
"eslint-config-prettier": "9.1.0",
Expand Down
Loading

0 comments on commit d05a3f2

Please sign in to comment.