Skip to content

chore: migrate markdown-spellcheck to cspell #1386

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

Merged
merged 5 commits into from
Dec 29, 2019
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
90 changes: 90 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -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 changes: 0 additions & 126 deletions .spelling

This file was deleted.

3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"recommendations": [
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"editorconfig.editorconfig"
"editorconfig.editorconfig",
"streetsidesoftware.code-spell-checker"
],
"unwantedRecommendations": ["hookyqr.beautify", "dbaeumer.jshint"]
}
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}\"",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type Bar = {
}
```

- Linebreak (none) style.
- Line break (none) style.

<!-- prettier-ignore -->
```ts
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/no-floating-promises.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/prefer-readonly.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-plugin/docs/rules/typedef.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ function logsSize(size): void {
console.log(size);
}

const doublesSize = function(size): numeber {
const doublesSize = function(size): number {
return size * 2;
};

Expand Down Expand Up @@ -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;
};

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/src/rules/member-delimiter-style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
},
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/src/rules/no-extra-parens.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/src/rules/no-magic-numbers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/src/rules/no-use-before-define.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/src/rules/prefer-optional-chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/src/rules/require-await.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading