Skip to content

Commit

Permalink
✨ Allo destructed naming (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
fyrstelin authored Feb 22, 2022
1 parent 648d933 commit 7e5ccf4
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 5 deletions.
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ module.exports = {
"selector": "variable",
"format": ["UPPER_CASE", "strictCamelCase"],
"modifiers": ["const", "global"]
},
{
"selector": ["variable", "parameter"],
"format": null,
"modifiers": ["destructured"]
}
],
"react-hooks/rules-of-hooks": "error",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@paralenz/eslint-config-typescript-react",
"version": "1.0.6",
"version": "1.0.7",
"description": "Paralenz eslint configuration for typescript and React",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -50,4 +50,4 @@
"ts-node": "^10.4.0",
"typescript": "^4.4.4"
}
}
}
18 changes: 18 additions & 0 deletions tests/@typescript-eslint/naming-convention/destructing.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* eslint-disable @typescript-eslint/naming-convention */
type ImportedType = {
uses_snake_case: string
AndPascalCase: string
}
/* eslint-enable @typescript-eslint/naming-convention */

export function foo({
uses_snake_case,
AndPascalCase
}: ImportedType) {
console.log(uses_snake_case, AndPascalCase)
}

export function bar(type: ImportedType) {
const { uses_snake_case, AndPascalCase } = type
console.log(uses_snake_case, AndPascalCase)
}
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1176,9 +1176,9 @@ camelcase@^6.2.0:
integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==

caniuse-lite@^1.0.30001219:
version "1.0.30001231"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001231.tgz#6c1f9b49fc27cc368b894e64b9b28b39ef80603b"
integrity sha512-WAFFv31GgU4DiwNAy77qMo3nNyycEhH3ikcCVHvkQpPe/fO8Tb2aRYzss8kgyLQBm8mJ7OryW4X6Y4vsBCIqag==
version "1.0.30001312"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001312.tgz"
integrity sha512-Wiz1Psk2MEK0pX3rUzWaunLTZzqS2JYZFzNKqAiJGiuxIjRPLgV6+VDPOg6lQOUxmDwhTlh198JsTTi8Hzw6aQ==

chalk@^2.0.0:
version "2.4.2"
Expand Down

0 comments on commit 7e5ccf4

Please sign in to comment.