Skip to content
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
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 = {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to originally suggest keeping this as json if it didn't break anything, but this will align perfectly with the changes we'll need to make for future of configuring ESLint. 🎉

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it needs to be a cjs file so I can use __dirname

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
}
}
}
};