-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Add cspell dictionary #11953
Open
jjspace
wants to merge
5
commits into
main
Choose a base branch
from
cspell-dict
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add cspell dictionary #11953
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9c3acf5
add cspell dictionary, ts-expect-error in sandcastle
jjspace 4bb811d
Merge remote-tracking branch 'origin/main' into cspell-dict
jjspace dd40202
add more configuration
jjspace 03654f4
some small spelling corrections
jjspace f803125
add some documentation
jjspace File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
cesium | ||
engine | ||
widgets | ||
playwright | ||
test | ||
chokidar | ||
cloc | ||
compression | ||
esbuild | ||
eslint | ||
config | ||
plugin | ||
html | ||
express | ||
globals | ||
globby | ||
glsl | ||
strip | ||
comments | ||
gulp | ||
clean | ||
css | ||
insert | ||
rename | ||
replace | ||
tap | ||
zip | ||
husky | ||
istanbul | ||
lib | ||
instrument | ||
jasmine | ||
core | ||
jsdoc | ||
karma | ||
chrome | ||
launcher | ||
coverage | ||
detect | ||
browsers | ||
edge | ||
firefox | ||
ie | ||
longest | ||
reporter | ||
safari | ||
sourcemap | ||
loader | ||
spec | ||
markdownlint | ||
cli | ||
merge | ||
stream | ||
mkdirp | ||
node | ||
fetch | ||
open | ||
prettier | ||
prismjs | ||
request | ||
rimraf | ||
sinon | ||
tsd | ||
typescript | ||
yargs | ||
tweenjs | ||
tween | ||
autolinker | ||
bitmap | ||
sdf | ||
dompurify | ||
draco3d | ||
earcut | ||
grapheme | ||
splitter | ||
jsep | ||
kdbush | ||
ktx | ||
parse | ||
lerc | ||
mersenne | ||
twister | ||
meshoptimizer | ||
pako | ||
protobufjs | ||
rbush | ||
topojson | ||
client | ||
urijs | ||
nosleep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { readFileSync, writeFileSync } from "fs"; | ||
import path from "path"; | ||
import { fileURLToPath } from "url"; | ||
|
||
// inspired by code in https://github.com/streetsidesoftware/cspell/issues/3215 | ||
// this file just generates the word list file in this directory that contains | ||
// all our dependecy package names | ||
|
||
const __filename = fileURLToPath(import.meta.url); // get the resolved path to the file | ||
const __dirname = path.dirname(__filename); // get the name of the directory | ||
|
||
const packageJsons = [ | ||
path.join(__dirname, "../package.json"), | ||
path.join(__dirname, "../packages/engine/package.json"), | ||
path.join(__dirname, "../packages/widgets/package.json"), | ||
]; | ||
const words = packageJsons.reduce((acc, packageJsonPath) => { | ||
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8")); | ||
const packageNames = Object.keys(packageJson.dependencies ?? {}).concat( | ||
Object.keys(packageJson.devDependencies ?? {}) | ||
); | ||
// remove the @ org symbol and dashes to get just words in package names | ||
const setOfWords = packageNames | ||
.flatMap((name) => name.replace(/[@]/g, "").split(/\/|\-/)) | ||
.map((word) => word.replace(".js", "")); | ||
setOfWords.forEach((word) => acc.add(word)); | ||
return acc; | ||
}, new Set()); | ||
|
||
// if https://github.com/streetsidesoftware/vscode-spell-checker/issues/3002 | ||
// ever gets addressed this can be used to auto-generate the list of package names | ||
// to pass to cspell directly. Right now it works in the CLI but not in the extension | ||
writeFileSync("./cspell-packages.txt", Array.from(words).join("\n")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
{ | ||
"version": "0.2", | ||
"language": "en", | ||
"allowCompoundWords": true, | ||
"caseSensitive": false, | ||
"files": [ | ||
"**/*.js", | ||
"**/*.html", | ||
"**/*.css", | ||
"**/*.md" | ||
], | ||
"ignorePaths": [ | ||
"node_modules/**", | ||
"**/ThirdParty/**", | ||
"**/Build/**", | ||
"Source/**", | ||
"CONTRIBUTORS.md", | ||
"**/LICENSE.md" | ||
], | ||
"useGitignore": true, | ||
"dictionaries": [ | ||
"typescript", | ||
"node", | ||
"html", | ||
"css", | ||
"packages" | ||
], | ||
"dictionaryDefinitions": [ | ||
{ | ||
"name": "packages", | ||
"path": "./.cspell/cspell-packages.txt", | ||
"addWords": false | ||
} | ||
], | ||
"words": [ | ||
"3DTILES", | ||
"aabb", | ||
"Amato", | ||
"bathymetric", | ||
"bitangent", | ||
"bitangents", | ||
"bivariate", | ||
"Bourke", | ||
"brdf", | ||
"cartesians", | ||
"cartographics", | ||
"cesiumjs", | ||
"comms", | ||
"cyclomatic", | ||
"czml", | ||
"dequantize", | ||
"dequantized", | ||
"dequantizes", | ||
"dijit", | ||
"DONT", | ||
"ecef", | ||
"EPSG", | ||
"fxaa", | ||
"glsl", | ||
"gltf", | ||
"iframes", | ||
"iife", | ||
"lerp", | ||
"Lilli", | ||
"MAXAR", | ||
"minifiers", | ||
"mipmapped", | ||
"mipmaps", | ||
"msaa", | ||
"noaa", | ||
"Occluder", | ||
"occluders", | ||
"octree", | ||
"octrees", | ||
"OITFS", | ||
"pako", | ||
"phong", | ||
"pjcozzi", | ||
"pnts", | ||
"quantizations", | ||
"reproject", | ||
"tada", | ||
"topo", | ||
"topojson", | ||
"Transitioner", | ||
"tridiagonal", | ||
"tweens", | ||
"uncentered", | ||
"uncompress", | ||
"unminified", | ||
"unproject", | ||
"unregisters", | ||
"unrenderable", | ||
"voxel", | ||
"WEBG", | ||
"xdescribe" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -117,6 +117,14 @@ A few more naming conventions are introduced below along with their design patte | |||||
- For HTML code, keep the existing style. Use double quotes. | ||||||
- Text files, end with a newline to minimize the noise in diffs. | ||||||
|
||||||
## Spelling | ||||||
|
||||||
- We have a basic setup for `cspell` to spellcheck our files. This is currently not enforced but recommended to use and check while programming. This is especially true for JSDoc comments that well end up in our documentation or Readme files | ||||||
- Run `npm run cspell` to check all files | ||||||
- Run `npx cspell -c .vscode/cspell.json [file path]` to check a specific file | ||||||
- If you are using VSCode you can use the [Code Spell Checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) extension to highlight misspelled words and add them to our wordlist if they are valid. | ||||||
- Using cspell optional while we build up the wordlist but may eventually be required as part of our git hooks and CI. See [this issue](https://github.com/CesiumGS/cesium/issues/11954) for an active status on that. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
## Linting | ||||||
|
||||||
For syntax and style guidelines, we use the ESLint recommended settings (the list of rules can be found [here](http://eslint.org/docs/rules/)) as a base and extend it with additional rules via a shared config Node module, [eslint-config-cesium](https://www.npmjs.com/package/eslint-config-cesium). This package is maintained as a part of the Cesium repository and is also used throughout the Cesium ecosystem. For an up to date list of which rules are enabled, look in [index.js](https://github.com/CesiumGS/eslint-config-cesium/blob/main/index.js), [browser.js](https://github.com/CesiumGS/eslint-config-cesium/blob/main/browser.js), and [node.js](https://github.com/CesiumGS/eslint-config-cesium/blob/main/node.js). Below are listed some specific rules to keep in mind | ||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.