From 48bc416bb2aa28c2f6184431cae2c1842d9e4c89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Fl=C3=B3rez?= Date: Sun, 20 Feb 2022 00:12:07 -0500 Subject: [PATCH] fix: remove boolean naming convention rule in destructured vars --- samples/users.tsx | 17 ++++++++++++++++- stylistic.js | 6 ++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/samples/users.tsx b/samples/users.tsx index 198cb76..da8a8d0 100644 --- a/samples/users.tsx +++ b/samples/users.tsx @@ -2,6 +2,10 @@ import React from 'react' export default Users +const response = [false, () => {}] + +const [loading, setIsLoading] = response + enum Profile { Admin = 'Admin', } @@ -34,5 +38,16 @@ export function variableNames() { const CONST_VALUE = Profile.Admin const __DEV__ = 'global constant' const _ = 'Ignore variable' - return {$el, user$, camelCase, PascalCase, __thing, __DEV__, CONST_VALUE, _} + const isLoading = [loading, setIsLoading] + return { + $el, + user$, + camelCase, + PascalCase, + __thing, + __DEV__, + CONST_VALUE, + _, + isLoading, + } } diff --git a/stylistic.js b/stylistic.js index 7a87af2..e668aa1 100644 --- a/stylistic.js +++ b/stylistic.js @@ -109,6 +109,12 @@ module.exports = { modifiers: ['destructured'], format: null, }, + { + selector: 'variable', + types: ['boolean'], + modifiers: ['destructured'], + format: null, + }, { selector: 'function', format: ['camelCase', 'PascalCase'],