Skip to content

Commit 5d5cf65

Browse files
committed
ci: allow lint-staged to find typescript parser config file
1 parent de33afd commit 5d5cf65

File tree

4 files changed

+71
-82
lines changed

4 files changed

+71
-82
lines changed

.lintstagedrc.cjs

Lines changed: 0 additions & 19 deletions
This file was deleted.

.lintstagedrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"*.{json,html,yml}": ["prettier --write"],
3+
"*.scss": ["stylelint --fix", "prettier --write"],
4+
"packages/**/*.{ts,tsx}": ["eslint --ext .ts,.tsx --fix", "prettier --write"],
5+
"*.md": ["markdownlint --fix --disable MD024 MD013 MD041 MD033", "prettier --write"]
6+
}

package-lock.json

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 49 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
1-
{
2-
"env": {
1+
module.exports = {
2+
root: true,
3+
env: {
34
"jest/globals": true
45
},
5-
"extends": [
6+
extends: [
67
"plugin:@esri/calcite-components/recommended",
78
"plugin:@stencil-community/recommended",
89
"plugin:@typescript-eslint/recommended",
910
"plugin:jest/recommended",
1011
"plugin:jsdoc/recommended",
1112
"prettier"
1213
],
13-
"ignorePatterns": ["dist", "docs", "hydrate", "www"],
14-
"parser": "@typescript-eslint/parser",
15-
"parserOptions": {
16-
"project": "./tsconfig-eslint.json",
17-
"ecmaVersion": 2018,
18-
"sourceType": "module"
14+
ignorePatterns: ["dist", "docs", "hydrate", "www"],
15+
parser: "@typescript-eslint/parser",
16+
parserOptions: {
17+
tsconfigRootDir: __dirname,
18+
project: ["tsconfig-eslint.json"],
19+
ecmaVersion: 2021,
20+
sourceType: "module"
1921
},
20-
"plugins": [
22+
plugins: [
2123
"@esri/calcite-components",
2224
"@typescript-eslint",
2325
"eslint-plugin-react",
@@ -27,16 +29,16 @@
2729
"prettier",
2830
"unicorn"
2931
],
30-
"rules": {
32+
rules: {
3133
"@esri/calcite-components/ban-events": [
3234
"warn",
3335
{
34-
"event": "keyup",
35-
"message": "Use keydown instead for consistent interaction behavior (e.g., closing, moving focus, etc.)."
36+
event: "keyup",
37+
message: "Use keydown instead for consistent interaction behavior (e.g., closing, moving focus, etc.)."
3638
},
3739
{
38-
"event": "keypress",
39-
"message": "Use keydown instead for consistent interaction behavior (e.g., closing, moving focus, etc.)."
40+
event: "keypress",
41+
message: "Use keydown instead for consistent interaction behavior (e.g., closing, moving focus, etc.)."
4042
}
4143
],
4244
"@stencil-community/decorators-context": "off",
@@ -51,8 +53,8 @@
5153
"@typescript-eslint/explicit-module-boundary-types": [
5254
"error",
5355
{
54-
"allowArgumentsExplicitlyTypedAsAny": true,
55-
"allowedNames": [
56+
allowArgumentsExplicitlyTypedAsAny: true,
57+
allowedNames: [
5658
"connectedCallback",
5759
"disconnectedCallback",
5860
"componentWillRender",
@@ -67,50 +69,50 @@
6769
],
6870
"@typescript-eslint/no-explicit-any": "off",
6971
"@typescript-eslint/no-unused-vars": "error",
70-
"curly": "error",
71-
"import/no-dynamic-require": ["error", { "esmodule": true }],
72+
curly: "error",
73+
"import/no-dynamic-require": ["error", { esmodule: true }],
7274
"jest/expect-expect": "off",
7375
"jest/no-export": "warn",
7476
"jsdoc/check-tag-names": "off",
7577
"jsdoc/require-jsdoc": "off",
76-
"jsdoc/tag-lines": ["error", "any", { "startLines": 1 }],
78+
"jsdoc/tag-lines": ["error", "any", { startLines: 1 }],
7779
"lines-between-class-members": ["error", "always"],
7880
"no-eval": "error",
7981
"no-implied-eval": "error",
8082
"no-multiple-empty-lines": [
8183
"error",
8284
{
83-
"max": 1
85+
max: 1
8486
}
8587
],
8688
"no-new-func": "error",
8789
"no-unneeded-ternary": "error",
8890
"react/forbid-component-props": [
8991
"warn",
9092
{
91-
"forbid": [
93+
forbid: [
9294
{
93-
"propName": "onKeyPress",
94-
"message": "Use onKeyDown instead for consistent interaction behavior (e.g., closing, moving focus, etc.)."
95+
propName: "onKeyPress",
96+
message: "Use onKeyDown instead for consistent interaction behavior (e.g., closing, moving focus, etc.)."
9597
},
9698
{
97-
"propName": "onKeyUp",
98-
"message": "Use onKeyDown instead for consistent interaction behavior (e.g., closing, moving focus, etc.)."
99+
propName: "onKeyUp",
100+
message: "Use onKeyDown instead for consistent interaction behavior (e.g., closing, moving focus, etc.)."
99101
}
100102
]
101103
}
102104
],
103105
"react/forbid-dom-props": [
104106
"warn",
105107
{
106-
"forbid": [
108+
forbid: [
107109
{
108-
"propName": "onKeyPress",
109-
"message": "Use onKeyDown instead for consistent interaction behavior (e.g., closing, moving focus, etc.)."
110+
propName: "onKeyPress",
111+
message: "Use onKeyDown instead for consistent interaction behavior (e.g., closing, moving focus, etc.)."
110112
},
111113
{
112-
"propName": "onKeyUp",
113-
"message": "Use onKeyDown instead for consistent interaction behavior (e.g., closing, moving focus, etc)."
114+
propName: "onKeyUp",
115+
message: "Use onKeyDown instead for consistent interaction behavior (e.g., closing, moving focus, etc)."
114116
}
115117
]
116118
}
@@ -123,28 +125,28 @@
123125
"unicorn/prevent-abbreviations": [
124126
"error",
125127
{
126-
"allowList": {
127-
"e2ePage": true
128+
allowList: {
129+
e2ePage: true
128130
},
129-
"extendDefaultReplacements": false,
130-
"replacements": {
131-
"e": {
132-
"error": true,
133-
"event": true
131+
extendDefaultReplacements: false,
132+
replacements: {
133+
e: {
134+
error: true,
135+
event: true
134136
}
135137
},
136-
"checkProperties": false,
137-
"checkFilenames": false
138+
checkProperties: false,
139+
checkFilenames: false
138140
}
139141
]
140142
},
141-
"settings": {
142-
"react": {
143-
"pragma": "h"
143+
settings: {
144+
react: {
145+
pragma: "h"
144146
},
145-
"jsdoc": {
146-
"ignoreInternal": true,
147-
"ignorePrivate": true
147+
jsdoc: {
148+
ignoreInternal: true,
149+
ignorePrivate: true
148150
}
149151
}
150-
}
152+
};

0 commit comments

Comments
 (0)