Skip to content
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

chore(linting): update ESLint setup #10909

Merged
merged 1 commit into from
Nov 27, 2024
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
4 changes: 2 additions & 2 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"*.{json,html,yml}": ["prettier --write"],
"*.scss": ["stylelint --fix", "prettier --write"],
"packages/**/*.{ts,tsx}": ["eslint --ext .ts,.tsx --fix", "prettier --write"],
".github/scripts/*.js": ["eslint --ext .js", "prettier --write"],
"packages/**/*.{ts,tsx}": ["cross-env ESLINT_USE_FLAT_CONFIG=false eslint --ext .ts,.tsx --fix", "prettier --write"],
".github/scripts/*.js": ["cross-env ESLINT_USE_FLAT_CONFIG=false eslint --ext .js", "prettier --write"],
"*.md": ["prettier --write", "markdownlint --fix"]
}
20 changes: 20 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
"conventional-changelog-conventionalcommits": "7.0.2",
"cpy": "11.1.0",
"cpy-cli": "5.0.0",
"cross-env": "7.0.3",
"dedent": "1.5.3",
"eslint": "9.15.0",
"eslint-config-prettier": "9.1.0",
Expand Down
28 changes: 14 additions & 14 deletions packages/calcite-components/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,6 @@ module.exports = {
ecmaVersion: 2021,
sourceType: "module",
},
plugins: [
"@esri/calcite-components",
"@typescript-eslint",
"eslint-plugin-react",
"import",
"jest",
"jsdoc",
"prettier",
"unicorn",
],
rules: {
"@esri/calcite-components/ban-events": [
"warn",
Expand All @@ -44,7 +34,6 @@ module.exports = {
],
"@esri/calcite-components/enforce-ref-last-prop": "off",
"@esri/calcite-components/strict-boolean-attributes": "off",
"@typescript-eslint/ban-types": "warn",
"@typescript-eslint/explicit-module-boundary-types": [
"error",
{
Expand All @@ -62,11 +51,13 @@ module.exports = {
],
},
],
"@typescript-eslint/lines-between-class-members": ["error", "always"],
"@typescript-eslint/method-signature-style": ["error", "property"],
"@typescript-eslint/no-empty-object-type": "warn",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-unused-expressions": "warn",
"@typescript-eslint/no-unused-vars": "warn",
"no-constant-binary-expression": "warn",
curly: "error",
"import/no-dynamic-require": ["error", { esmodule: true }],
"import/order": ["error", { "newlines-between": "never" }],
Expand All @@ -90,7 +81,6 @@ module.exports = {
"jsdoc/require-property-type": "off",
"jsdoc/require-returns-type": "off",
"jsdoc/tag-lines": ["error", "any", { startLines: 1 }],
"lines-between-class-members": "off",
"no-eval": "error",
"no-implied-eval": "error",
"no-multiple-empty-lines": [
Expand Down Expand Up @@ -168,6 +158,16 @@ module.exports = {
},
],
},
plugins: [
"@esri/calcite-components",
"@typescript-eslint",
"eslint-plugin-react",
"import",
"jest",
"jsdoc",
"prettier",
"unicorn",
],
settings: {
react: {
pragma: "h",
Expand Down
2 changes: 1 addition & 1 deletion packages/calcite-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"lint:json": "prettier --write \"**/*.json\" >/dev/null",
"lint:md": "prettier --write \"**/*.md\" >/dev/null && markdownlint \"**/*.md\" --fix --dot --ignore-path .gitignore",
"lint:scss": "stylelint --fix \"src/**/*.scss\" && prettier --write \"**/*.scss\" >/dev/null",
"lint:ts": "eslint --ext .ts,.tsx --fix . && prettier --write \"**/*.ts?(x)\" >/dev/null",
"lint:ts": "cross-env ESLINT_USE_FLAT_CONFIG=false eslint --ext .ts,.tsx --fix . && prettier --write \"**/*.ts?(x)\" >/dev/null",
"prepublish": "./support/cleanupDistFiles.sh",
"screenshot-tests": "npm run build-storybook",
"screenshot-tests:preview": "npm run util:prep-build-reqs && NODE_OPTIONS=--openssl-legacy-provider STORYBOOK_SCREENSHOT_LOCAL_BUILD=true storybook dev",
Expand Down
2 changes: 1 addition & 1 deletion packages/calcite-design-tokens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"clean": "rimraf dist",
"lint:json": "prettier --write \"**/*.json\" >/dev/null",
"lint:md": "prettier --write \"**/*.md\" >/dev/null && markdownlint \"**/*.md\" --fix --dot --ignore-path ../../.gitignore",
"lint:ts": "eslint --ext .ts,.tsx --fix . && prettier --write \"**/*.ts?(x)\" >/dev/null",
"lint:ts": "cross-env ESLINT_USE_FLAT_CONFIG=false eslint --ext .ts,.tsx --fix . && prettier --write \"**/*.ts?(x)\" >/dev/null",
"lint": "concurrently npm:lint:*",
"test": "NODE_OPTIONS=\"--experimental-vm-modules\" jest"
},
Expand Down
Loading