Skip to content

Commit

Permalink
fix: remove boolean naming convention rule in destructured vars
Browse files Browse the repository at this point in the history
  • Loading branch information
crisfcodes committed Feb 20, 2022
1 parent efba002 commit 48bc416
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
17 changes: 16 additions & 1 deletion samples/users.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import React from 'react'

export default Users

const response = [false, () => {}]

const [loading, setIsLoading] = response

enum Profile {
Admin = 'Admin',
}
Expand Down Expand Up @@ -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,
}
}
6 changes: 6 additions & 0 deletions stylistic.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ module.exports = {
modifiers: ['destructured'],
format: null,
},
{
selector: 'variable',
types: ['boolean'],
modifiers: ['destructured'],
format: null,
},
{
selector: 'function',
format: ['camelCase', 'PascalCase'],
Expand Down

0 comments on commit 48bc416

Please sign in to comment.