Skip to content

Commit

Permalink
ci: allow lint-staged to find typescript parser config file (#7297)
Browse files Browse the repository at this point in the history
**Related Issue:** N/A

## Summary

`lint-staged` correctly fails now when there are eslint errors in
`packages/calcite-components`.
  • Loading branch information
benelan authored Jul 8, 2023
1 parent 2b09aba commit ef6e90d
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 66 deletions.
19 changes: 0 additions & 19 deletions .lintstagedrc.cjs

This file was deleted.

6 changes: 6 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"*.{json,html,yml}": ["prettier --write"],
"*.scss": ["stylelint --fix", "prettier --write"],
"packages/**/*.{ts,tsx}": ["eslint --ext .ts,.tsx --fix", "prettier --write"],
"*.md": ["markdownlint --fix --disable MD024 MD013 MD041 MD033", "prettier --write"]
}
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
{
"env": {
module.exports = {
root: true,
env: {
"jest/globals": true
},
"extends": [
extends: [
"plugin:@esri/calcite-components/recommended",
"plugin:@stencil-community/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:jest/recommended",
"plugin:jsdoc/recommended",
"prettier"
],
"ignorePatterns": ["dist", "docs", "hydrate", "www"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig-eslint.json",
"ecmaVersion": 2018,
"sourceType": "module"
ignorePatterns: ["dist", "docs", "hydrate", "www"],
parser: "@typescript-eslint/parser",
parserOptions: {
tsconfigRootDir: __dirname,
project: ["tsconfig-eslint.json"],
ecmaVersion: 2021,
sourceType: "module"
},
"plugins": [
plugins: [
"@esri/calcite-components",
"@typescript-eslint",
"eslint-plugin-react",
Expand All @@ -27,16 +29,16 @@
"prettier",
"unicorn"
],
"rules": {
rules: {
"@esri/calcite-components/ban-events": [
"warn",
{
"event": "keyup",
"message": "Use keydown instead for consistent interaction behavior (e.g., closing, moving focus, etc.)."
event: "keyup",
message: "Use keydown instead for consistent interaction behavior (e.g., closing, moving focus, etc.)."
},
{
"event": "keypress",
"message": "Use keydown instead for consistent interaction behavior (e.g., closing, moving focus, etc.)."
event: "keypress",
message: "Use keydown instead for consistent interaction behavior (e.g., closing, moving focus, etc.)."
}
],
"@stencil-community/decorators-context": "off",
Expand All @@ -51,8 +53,8 @@
"@typescript-eslint/explicit-module-boundary-types": [
"error",
{
"allowArgumentsExplicitlyTypedAsAny": true,
"allowedNames": [
allowArgumentsExplicitlyTypedAsAny: true,
allowedNames: [
"connectedCallback",
"disconnectedCallback",
"componentWillRender",
Expand All @@ -67,50 +69,50 @@
],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "error",
"curly": "error",
"import/no-dynamic-require": ["error", { "esmodule": true }],
curly: "error",
"import/no-dynamic-require": ["error", { esmodule: true }],
"jest/expect-expect": "off",
"jest/no-export": "warn",
"jsdoc/check-tag-names": "off",
"jsdoc/require-jsdoc": "off",
"jsdoc/tag-lines": ["error", "any", { "startLines": 1 }],
"jsdoc/tag-lines": ["error", "any", { startLines: 1 }],
"lines-between-class-members": ["error", "always"],
"no-eval": "error",
"no-implied-eval": "error",
"no-multiple-empty-lines": [
"error",
{
"max": 1
max: 1
}
],
"no-new-func": "error",
"no-unneeded-ternary": "error",
"react/forbid-component-props": [
"warn",
{
"forbid": [
forbid: [
{
"propName": "onKeyPress",
"message": "Use onKeyDown instead for consistent interaction behavior (e.g., closing, moving focus, etc.)."
propName: "onKeyPress",
message: "Use onKeyDown instead for consistent interaction behavior (e.g., closing, moving focus, etc.)."
},
{
"propName": "onKeyUp",
"message": "Use onKeyDown instead for consistent interaction behavior (e.g., closing, moving focus, etc.)."
propName: "onKeyUp",
message: "Use onKeyDown instead for consistent interaction behavior (e.g., closing, moving focus, etc.)."
}
]
}
],
"react/forbid-dom-props": [
"warn",
{
"forbid": [
forbid: [
{
"propName": "onKeyPress",
"message": "Use onKeyDown instead for consistent interaction behavior (e.g., closing, moving focus, etc.)."
propName: "onKeyPress",
message: "Use onKeyDown instead for consistent interaction behavior (e.g., closing, moving focus, etc.)."
},
{
"propName": "onKeyUp",
"message": "Use onKeyDown instead for consistent interaction behavior (e.g., closing, moving focus, etc)."
propName: "onKeyUp",
message: "Use onKeyDown instead for consistent interaction behavior (e.g., closing, moving focus, etc)."
}
]
}
Expand All @@ -123,28 +125,28 @@
"unicorn/prevent-abbreviations": [
"error",
{
"allowList": {
"e2ePage": true
allowList: {
e2ePage: true
},
"extendDefaultReplacements": false,
"replacements": {
"e": {
"error": true,
"event": true
extendDefaultReplacements: false,
replacements: {
e: {
error: true,
event: true
}
},
"checkProperties": false,
"checkFilenames": false
checkProperties: false,
checkFilenames: false
}
]
},
"settings": {
"react": {
"pragma": "h"
settings: {
react: {
pragma: "h"
},
"jsdoc": {
"ignoreInternal": true,
"ignorePrivate": true
jsdoc: {
ignoreInternal: true,
ignorePrivate: true
}
}
}
};

0 comments on commit ef6e90d

Please sign in to comment.