Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add yarn eslint example #6460

Merged
merged 3 commits into from
Nov 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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": "[email protected]",
"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
Loading