Skip to content

Commit 0108e35

Browse files
committed
Improve linting
1 parent 16d807d commit 0108e35

5 files changed

Lines changed: 42 additions & 4 deletions

File tree

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/

.eslintrc.json

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"project": ["./tsconfig.lint.json"],
2121
"warnOnUnsupportedTypeScriptVersion": false
2222
},
23-
"plugins": ["@typescript-eslint", "prettier", "jsdoc", "spellcheck"],
23+
"plugins": ["@typescript-eslint", "prettier", "jsdoc", "spellcheck", "inclusive-language"],
2424
"rules": {
2525
"curly": ["error"],
2626
"linebreak-style": ["error", "unix"],
@@ -98,6 +98,7 @@
9898
"href",
9999
"javascript",
100100
"jsdoc",
101+
"junit",
101102
"len",
102103
"lex",
103104
"lex",
@@ -129,6 +130,24 @@
129130
"xml"
130131
]
131132
}
133+
],
134+
135+
"inclusive-language/use-inclusive-words": [
136+
"warn",
137+
{
138+
"allowedTerms": [
139+
{
140+
"term": "/master",
141+
"allowPartialMatches": true
142+
}
143+
],
144+
"words": [
145+
{
146+
"word": "guys",
147+
"suggestions": ["folks"]
148+
}
149+
]
150+
}
132151
]
133152
},
134153
"settings": {

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
"scripts": {
77
"build": "tsc",
88
"format": "prettier --write .",
9-
"lint": "yarn lint:src && yarn lint:test",
10-
"lint:src": "eslint --ext .ts src",
11-
"lint:test": "eslint --ext .test.ts tests",
9+
"lint": "eslint .",
1210
"test": "jest"
1311
},
1412
"keywords": [
@@ -45,6 +43,7 @@
4543
"benchmark": "~2.1.4",
4644
"eslint": "~7.21.0",
4745
"eslint-config-prettier": "~8.1.0",
46+
"eslint-plugin-inclusive-language": "~2.1.1",
4847
"eslint-plugin-jsdoc": "~32.2.0",
4948
"eslint-plugin-prettier": "~3.3.1",
5049
"eslint-plugin-spellcheck": "~0.0.17",

tests/common.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
import { AttributeToken } from 'pug-lexer';
22

3+
/**
4+
* Creates a fake attribute token.
5+
*
6+
* @param name Name of the attribute.
7+
* @param val Value of the attribute. Default `'dummy'`.
8+
* @returns A fake attribute token.
9+
*/
310
export function createAttributeToken(name: string, val: string | boolean = 'dummy'): AttributeToken {
411
return {
512
name,

yarn.lock

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,6 +1476,13 @@ eslint-config-prettier@~8.1.0:
14761476
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.1.0.tgz#4ef1eaf97afe5176e6a75ddfb57c335121abc5a6"
14771477
integrity sha512-oKMhGv3ihGbCIimCAjqkdzx2Q+jthoqnXSP+d86M9tptwugycmTFdVR4IpLgq2c4SHifbwO90z2fQ8/Aio73yw==
14781478

1479+
eslint-plugin-inclusive-language@~2.1.1:
1480+
version "2.1.1"
1481+
resolved "https://registry.yarnpkg.com/eslint-plugin-inclusive-language/-/eslint-plugin-inclusive-language-2.1.1.tgz#74875a0a93da343587c735854c706cc22579fd4d"
1482+
integrity sha512-/dJC035CntrE7JpmQk0lId340iJZ3wUp22dUIy33CVSbO0t9jffeIe0lM0H9281ISdfB4oERvbq3iMK7f0YRDQ==
1483+
dependencies:
1484+
humps "^2.0.1"
1485+
14791486
eslint-plugin-jsdoc@~32.2.0:
14801487
version "32.2.0"
14811488
resolved "https://registry.yarnpkg.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-32.2.0.tgz#d848ea8475a9be63d8d261bd7fa01cf2a2bb32d5"
@@ -2067,6 +2074,11 @@ human-signals@^1.1.1:
20672074
resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3"
20682075
integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==
20692076

2077+
humps@^2.0.1:
2078+
version "2.0.1"
2079+
resolved "https://registry.yarnpkg.com/humps/-/humps-2.0.1.tgz#dd02ea6081bd0568dc5d073184463957ba9ef9aa"
2080+
integrity sha1-3QLqYIG9BWjcXQcxhEY5V7qe+ao=
2081+
20702082
hunspell-spellchecker@^1.0.2:
20712083
version "1.0.2"
20722084
resolved "https://registry.yarnpkg.com/hunspell-spellchecker/-/hunspell-spellchecker-1.0.2.tgz#a10b0bd2fa00a65ab62a4c6b734ce496d318910e"

0 commit comments

Comments
 (0)