Skip to content
Permalink
Browse files

chore: migrate markdown-spellcheck to cspell (#1386)

  • Loading branch information
armano2 authored and bradzacher committed Dec 29, 2019
1 parent 8bf6879 commit b1c8c0a5889f0db1a96e90b512288553f68cc7ee
Showing with 480 additions and 340 deletions.
  1. +90 −0 .cspell.json
  2. +0 −126 .spelling
  3. +2 −1 .vscode/extensions.json
  4. +1 −0 CONTRIBUTING.md
  5. +2 −3 package.json
  6. +1 −1 packages/eslint-plugin/docs/rules/consistent-type-assertions.md
  7. +1 −1 packages/eslint-plugin/docs/rules/member-delimiter-style.md
  8. +1 −1 packages/eslint-plugin/docs/rules/no-floating-promises.md
  9. +1 −1 packages/eslint-plugin/docs/rules/no-unused-vars-experimental.md
  10. +1 −1 packages/eslint-plugin/docs/rules/prefer-readonly.md
  11. +2 −2 packages/eslint-plugin/docs/rules/typedef.md
  12. +1 −1 packages/eslint-plugin/src/rules/member-delimiter-style.ts
  13. +1 −1 packages/eslint-plugin/src/rules/no-extra-parens.ts
  14. +1 −1 packages/eslint-plugin/src/rules/no-magic-numbers.ts
  15. +1 −1 packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts
  16. +1 −1 packages/eslint-plugin/src/rules/no-unused-vars-experimental.ts
  17. +1 −1 packages/eslint-plugin/src/rules/no-use-before-define.ts
  18. +1 −1 packages/eslint-plugin/src/rules/prefer-optional-chain.ts
  19. +1 −1 packages/eslint-plugin/src/rules/require-await.ts
  20. +2 −2 packages/eslint-plugin/tests/rules/indent/indent-eslint.test.ts
  21. +1 −1 packages/eslint-plugin/tests/rules/prefer-nullish-coalescing.test.ts
  22. +1 −1 packages/experimental-utils/src/eslint-utils/deepMerge.ts
  23. +1 −1 packages/experimental-utils/src/index.ts
  24. +1 −1 packages/experimental-utils/src/ts-eslint-scope/Scope.ts
  25. +1 −1 packages/experimental-utils/src/ts-eslint/Rule.ts
  26. +1 −1 packages/experimental-utils/src/ts-eslint/RuleTester.ts
  27. +1 −1 packages/parser/src/analyze-scope.ts
  28. +1 −1 packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts
  29. +1 −1 packages/typescript-estree/tests/ast-alignment/utils.ts
  30. +1 −1 packages/typescript-estree/tests/lib/persistentParse.ts
  31. +358 −183 yarn.lock
@@ -0,0 +1,90 @@
{
"version": "0.1",
"language": "en",
"ignorePaths": [
"**/coverage/**",
"**/node_modules/**",
"**/dist/**",
"**/fixtures/**",
"**/**/CHANGELOG.md",
"**/**/CONTRIBUTORS.md",
"**/**/ROADMAP.md",
"**/*.json"
],
"dictionaries": [
"typescript",
"softwareTerms",
"node",
"en_US",
"npm",
"misc",
"filetypes"
],
"ignoreRegExpList": [
"/```[\\w\\W]*?```/",
"/~~~[\\w\\W]*?~~~/",
"/``[\\w\\W]*?``/",
"/`[^`]*`/",
"/\\.\\/docs\\/rules\\/[^.]*.md/",
"/@typescript-eslint\\/[a-z-]+/",
"/\\.all-contributorsrc/",
"/TS[^\\s]+/"
],
"words": [
"ASTs",
"Airbnb",
"Airbnb's",
"Codecov",
"Crockford",
"errored",
"IDE's",
"IIFE",
"IIFEs",
"OOM",
"OOMs",
"Premade",
"ROADMAP",
"autofix",
"autofixers",
"backticks",
"bigint",
"blockless",
"codebases",
"declarators",
"destructure",
"destructured",
"erroring",
"espree",
"estree",
"linebreaks",
"necroing",
"nullish",
"parameterised",
"performant",
"pluggable",
"postprocess",
"prettier's",
"reimplement",
"resync",
"ruleset",
"rulesets",
"superset",
"thenables",
"tsconfigs",
"tsutils",
"typedef",
"typedefs",
"unfixable",
"unprefixed"
],
"overrides": [
{
"filename": "**/*.{ts,js}",
"ignoreRegExpList": ["/@[a-z]+/", "/#(end)?region/"],
"includeRegExpList": [
"/\\/\\*[\\s\\S]*?\\*\\/|([^\\\\:]|^)\\/\\/.*$/",
"/(\\/\\/[^\\n\\r]*[\\n\\r]+)/"
]
}
]
}
126 .spelling

This file was deleted.

@@ -2,7 +2,8 @@
"recommendations": [
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"editorconfig.editorconfig"
"editorconfig.editorconfig",
"streetsidesoftware.code-spell-checker"
],
"unwantedRecommendations": ["hookyqr.beautify", "dbaeumer.jshint"]
}
@@ -52,6 +52,7 @@ We have a sophisticated CI process setup which gets run on every PR. You must pa
- You can run `yarn lint` in any package or in the root.
- If you have made changes to any markdown documentation, ensure there are no spelling errors
- You can run `yarn check:spelling` in the root.
- Or if you are using vscode, you can use [`Code Spell Checker`](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) plugin.
- If you have made changes within the `eslint-plugin` package, ensure the configs and documentation are valid.
- You can run `yarn check:configs` and `yarn check:docs` in the root, or in the `eslint-plugin` folder.

@@ -22,8 +22,7 @@
"cz": "git-cz",
"check:docs": "lerna run check:docs",
"check:configs": "lerna run check:configs",
"check:spelling": "yarn check:spelling-interactive -r",
"check:spelling-interactive": "mdspell '**/*.md' '!**/node_modules/**/*.md' '!**/CHANGELOG.md' '!**/CONTRIBUTORS.md' '!**/ROADMAP.md' --ignore-numbers --en-us",
"check:spelling": "cspell --config=.cspell.json **/*.{md,ts,js}",
"generate-contributors": "yarn ts-node --transpile-only ./tools/generate-contributors.ts && yarn all-contributors generate",
"format": "prettier --write \"./**/*.{ts,js,json,md}\"",
"format-check": "prettier --list-different \"./**/*.{ts,js,json,md}\"",
@@ -58,6 +57,7 @@
"@types/jest": "^24.0.23",
"@types/node": "^12.12.7",
"all-contributors-cli": "^6.11.0",
"cspell": "^4.0.43",
"cz-conventional-changelog": "^3.0.2",
"eslint": "^6.7.0",
"eslint-plugin-eslint-comments": "^3.1.2",
@@ -69,7 +69,6 @@
"jest": "^24.9.0",
"lerna": "^3.18.4",
"lint-staged": "^9.4.3",
"markdown-spellcheck": "^1.3.1",
"opencollective-postinstall": "^2.0.2",
"prettier": "^1.19.1",
"ts-jest": "^24.0.0",
@@ -32,7 +32,7 @@ This option defines the expected assertion style. Valid values for `assertionSty
- `angle-bracket` will enforce that you always use `<foo>...`
- `never` will enforce that you do not do any type assertions.

Most code bases will want to enforce not using `angle-bracket` style because it conflicts with JSX syntax, and is confusing when paired with with generic syntax.
Most codebases will want to enforce not using `angle-bracket` style because it conflicts with JSX syntax, and is confusing when paired with with generic syntax.

Some codebases like to go for an extra level of type safety, and ban assertions altogether via the `never` option.

@@ -32,7 +32,7 @@ type Bar = {
}
```
- Linebreak (none) style.
- Line break (none) style.
<!-- prettier-ignore -->
```ts
@@ -45,7 +45,7 @@ The rule accepts an options object with the following properties:

```ts
type Options = {
// if true, checking void expresions will be skipped
// if true, checking void expressions will be skipped
ignoreVoid?: boolean;
};
@@ -79,7 +79,7 @@ Examples of valid code based on the unchangeable compiler settings
import _UnusedDefault, { _UnusedNamed } from 'foo';
export function foo(_unusedProp: string) {}
export class Foo<_UnusedGeneric> {}
const { prop: _unusedDesctructure } = foo;
const { prop: _unusedDestructure } = foo;
```

## `ignoreArgsIfArgsAfterAreUsed`
@@ -17,7 +17,7 @@ class Container {
public constructor(
onlyModifiedInConstructor: number,
// Private parameter properties can also be marked as reaodnly
// Private parameter properties can also be marked as readonly
private neverModifiedParameter: string,
) {
this.onlyModifiedInConstructor = onlyModifiedInConstructor;
@@ -157,7 +157,7 @@ function logsSize(size): void {
console.log(size);
}
const doublesSize = function(size): numeber {
const doublesSize = function(size): number {
return size * 2;
};
@@ -185,7 +185,7 @@ function logsSize(size: number): void {
console.log(size);
}
const doublesSize = function(size: number): numeber {
const doublesSize = function(size: number): number {
return size * 2;
};
@@ -43,7 +43,7 @@ const definition = {
singleline: {
type: 'object',
properties: {
// note can't have "none" for single line delimiter as it's invlaid syntax
// note can't have "none" for single line delimiter as it's invalid syntax
delimiter: { enum: ['semi', 'comma'] },
requireLast: { type: 'boolean' },
},
@@ -1,4 +1,4 @@
// anys are required to work around manipulating the AST in weird ways
// any is required to work around manipulating the AST in weird ways
/* eslint-disable @typescript-eslint/no-explicit-any */

import {
@@ -79,7 +79,7 @@ export default util.createRule<Options, MessageIds>({
/**
* Checks if the node grandparent is a Typescript union type and its parent is a type alias declaration
* @param node the node to be validated.
* @returns true if the node grandparent is a Typescript untion type and its parent is a type alias declaration
* @returns true if the node grandparent is a Typescript union type and its parent is a type alias declaration
* @private
*/
function isGrandparentTSUnionType(node: TSESTree.Node): boolean {
@@ -156,7 +156,7 @@ export default util.createRule<Options, MessageIds>({
const type = util.getConstrainedTypeAtLocation(checker, node);
if (declarationType === type) {
// possibly used before assigned, so just skip it
// better to false negative and skip it, than false postiive and fix to compile erroring code
// better to false negative and skip it, than false positive and fix to compile erroring code
//
// no better way to figure this out right now
// https://github.com/Microsoft/TypeScript/issues/31124
@@ -244,7 +244,7 @@ export default util.createRule<Options, MessageIds>({
}

function handleDestructure(parent: ts.BindingPattern): void {
// the entire desctructure is unused
// the entire destructure is unused
// note that this case only ever triggers for simple, single-level destructured objects
// i.e. these will not trigger it:
// - const {a:_a, b, c: {d}} = z;
@@ -248,7 +248,7 @@ export default util.createRule<Options, MessageIds>({
const variable = reference.resolved;

// Skips when the reference is:
// - initialization's.
// - initializations.
// - referring to an undefined variable.
// - referring to a global environment variable (there're no identifiers).
// - located preceded by the variable (except in initializers).
@@ -228,7 +228,7 @@ export default util.createRule({
}

/**
* Gets a normalised representation of the given MemberExpression
* Gets a normalized representation of the given MemberExpression
*/
function getMemberExpressionText(
node: TSESTree.MemberExpression | TSESTree.OptionalMemberExpression,
@@ -48,7 +48,7 @@ export default util.createRule<Options, MessageIds>({
'ArrowFunctionExpression[async = true]'(
node: TSESTree.ArrowFunctionExpression,
): void {
// If body type is not BlockStatment, we need to check the return type here
// If body type is not BlockStatement, we need to check the return type here
if (node.body.type !== AST_NODE_TYPES.BlockStatement) {
const expression = parserServices.esTreeNodeToTSNodeMap.get(
node.body,

0 comments on commit b1c8c0a

Please sign in to comment.
You can’t perform that action at this time.