Skip to content

Commit

Permalink
replace typescript-eslint/ban-types with modern rules and @Stylistic
Browse files Browse the repository at this point in the history
  • Loading branch information
mcwinter07 committed Aug 12, 2024
1 parent aae4502 commit fac7a13
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 38 deletions.
43 changes: 6 additions & 37 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ module.exports = {
},
plugins: [
"@typescript-eslint",
"@stylistic",
"import",
"sort-imports-es6-autofix",
"ssr-friendly",
Expand All @@ -48,35 +49,9 @@ module.exports = {
default: "array-simple",
},
],
"@typescript-eslint/ban-types": [
"error",
{
types: {
Object: {
message: "Avoid using the `Object` type. Did you mean `object`?",
},
Function: {
message:
"Avoid using the `Function` type. Prefer a specific function type, like `() => void`.",
},
// eslint-disable-next-line
Boolean: {
message: "Avoid using the `Boolean` type. Did you mean `boolean`?",
},
// eslint-disable-next-line
Number: {
message: "Avoid using the `Number` type. Did you mean `number`?",
},
// eslint-disable-next-line
String: {
message: "Avoid using the `String` type. Did you mean `string`?",
},
Symbol: {
message: "Avoid using the `Symbol` type. Did you mean `symbol`?",
},
},
},
],
"@typescript-eslint/no-empty-object-type": "error",
"@typescript-eslint/no-unsafe-function-type": "error",
"@typescript-eslint/no-wrapper-object-types": "error",
"@typescript-eslint/class-name-casing": "off",
"@typescript-eslint/consistent-type-assertions": "off",
"@typescript-eslint/consistent-type-definitions": "off",
Expand Down Expand Up @@ -115,13 +90,6 @@ module.exports = {
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/prefer-namespace-keyword": "error",
"@typescript-eslint/quotes": [
"error",
"double",
{
avoidEscape: true,
},
],
"@typescript-eslint/semi": ["off", null],
"@typescript-eslint/triple-slash-reference": [
"error",
Expand All @@ -131,8 +99,9 @@ module.exports = {
lib: "always",
},
],
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unified-signatures": "error",
"@stylistic/quotes":[ "error", "double", { avoidEscape: true } ],
"@stylistic/type-annotation-spacing": "error",
"arrow-body-style": "warn",
"arrow-parens": ["error", "as-needed"],
"brace-style": ["error", "1tbs"],
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"dependencies": {
"@kaizen/design-tokens": "workspace:*",
"@kaizen/tailwind": "workspace:*",
"@stylistic/eslint-plugin": "^2.6.2",
"classnames": "^2.5.1",
"identity-obj-proxy": "^3.0.0",
"lodash.isempty": "^4.4.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export const VideoPlayer = ({
* https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide#autoplay_availability
*/
})
} catch (e) {
} catch {
/**
* Older browsers will raise a synchronous error because their first implementation
* of `.play` was not a promise.
Expand Down
101 changes: 101 additions & 0 deletions pnpm-lock.yaml

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

0 comments on commit fac7a13

Please sign in to comment.