Skip to content

Commit

Permalink
chore: Add yarn eslint example (#6460)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason3S authored Nov 3, 2024
1 parent dd1545d commit 7e1a5f3
Show file tree
Hide file tree
Showing 10 changed files with 1,806 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
"test-fixtures/**",
"test-packages/*/test-cspell-eslint-plugin*/**",
"test-packages/examples/example-cspell-lib-single-doc/samples/**",
"test-packages/*/test-cspell-tools/src/*.txt"
"test-packages/*/test-cspell-tools/src/*.txt",
"test-packages/yarn/yarn2/test-eslint-plugin/**"
],
"useGitignore": true,
"flagWords": [],
Expand Down
5 changes: 5 additions & 0 deletions test-packages/yarn/yarn2/test-eslint-plugin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ingore .yarn zero install because this is just a test package.
.yarn/cache
install-state.gz
.pnp.js
.pnp.*
4 changes: 4 additions & 0 deletions test-packages/yarn/yarn2/test-eslint-plugin/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
compressionLevel: mixed

enableGlobalCache: false
pnpEnableEsmLoader: true
18 changes: 18 additions & 0 deletions test-packages/yarn/yarn2/test-eslint-plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Sample Repository using Yarn and `@cspell/eslint-plugin`

**Usage**

```
yarn
yarn lint
```

## Medical Terms Test

This file contains some medical terms to be spell checked.

Sampled full list

abiana
abiate
abiatrophy
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
usePnP: true
import:
- ../cspell.json
- '@cspell/dict-medicalterms/cspell-ext.json'
words:
- medicalterms
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Contains custom terms for this project.
13 changes: 13 additions & 0 deletions test-packages/yarn/yarn2/test-eslint-plugin/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import globals from 'globals';
import pluginJs from '@eslint/js';
import cspellESLintPluginRecommended from '@cspell/eslint-plugin/recommended';

/** @type {import('eslint').Linter.Config[]} */
export default [
{ languageOptions: { globals: globals.browser } },
pluginJs.configs.recommended,
{
ignores: ['.pnp.cjs'],
},
cspellESLintPluginRecommended,
];
84 changes: 84 additions & 0 deletions test-packages/yarn/yarn2/test-eslint-plugin/index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
export const sampleWords = `
# Sample Repository using Yarn
# Medical Terms Test
This file contaains some medical terms to be spell checked.
Sampled full list
abiana
abiate
abiatrophy
abiatus
abid
abidi
abidochromis
abience
abient
abietene
abietic
abietine
abietite
abigeat
abigei
Abilify
abinoxylan
abio
AbioCor
abiogeneses
abiogenesis
abiogenetic
abiogenic
abiogenist
abiogenous
abiogeny
Abiological
Abiomed
AbioMed
abionergy
abioseston
abiosis
abiotic
abiotically
ZUMI
Zung
Zunrisa
Zuntz's
Zuplenz
Zweifel
zwitterion
Zyban
Zybit
Zyderm
Zydis
Zydone
Zyflo
zygal
zygapophyseal
zygapophyseales
zygapophysial
zygapophysiales
zygapophysis
zygia
zygion
Zygocotyle
zygodactyly
zygoma
zygomas
zygomatic
zygomatica
zygomatici
zygomatico
zygomaticoauricular
zygomaticofacial
zygomaticofacialis
zygomaticofrontal
zygomaticofrontalis
zygomaticomaxillaris
zygomaticomaxillary
zygomaticosphenoid
zygomaticotemporal
zygomaticotemporalis
`;
20 changes: 20 additions & 0 deletions test-packages/yarn/yarn2/test-eslint-plugin/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "test-eslint-plugin",
"version": "1.0.0",
"license": "MIT",
"private": true,
"packageManager": "yarn@4.5.1",
"scripts": {
"lint": "eslint .",
"test": "yarn update && yarn lint",
"update": "yarn add --dev @cspell/dict-medicalterms@latest @cspell/cspell-types@latest @cspell/eslint-plugin@latest"
},
"devDependencies": {
"@cspell/cspell-types": "^8.15.6",
"@cspell/dict-medicalterms": "^4.1.5",
"@cspell/eslint-plugin": "^8.15.6",
"@eslint/js": "^9.14.0",
"eslint": "^9.14.0",
"globals": "^15.11.0"
}
}
Loading

0 comments on commit 7e1a5f3

Please sign in to comment.