-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: conform new linting configuration (#1296)
- Loading branch information
Showing
206 changed files
with
1,813 additions
and
1,328 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.idea | ||
node_modules | ||
esm | ||
cjs | ||
coverage | ||
storybook-build | ||
CHANGELOG.md | ||
!.eslintrc.js | ||
!.prettierrc.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,65 @@ | ||
module.exports = { | ||
root: true, | ||
|
||
ignorePatterns: [ | ||
'node_modules', | ||
'coverage', | ||
'storybook-build', | ||
'dist', | ||
'.github/workflows', | ||
'.husky', | ||
'CHANGELOG.md', | ||
], | ||
|
||
parserOptions: { | ||
project: './tsconfig.eslint.json', | ||
tsconfigRootDir: __dirname, | ||
extraFileExtensions: ['.md'], | ||
extraFileExtensions: ['.md', '.mdx'], | ||
}, | ||
|
||
overrides: [ | ||
{ | ||
files: ['*.js', '*.ts', '*.jsx', '*.tsx'], | ||
extends: ['@react-hookz/eslint-config/react'], | ||
rules: { | ||
'react/button-has-type': 'off', | ||
'unicorn/prefer-node-protocol': 'off', | ||
'unicorn/prefer-top-level-await': 'off', | ||
}, | ||
files: ['*.js'], | ||
extends: ['@react-hookz/eslint-config/base.cjs'], | ||
}, | ||
{ | ||
files: [ | ||
'**/__tests__/**/*.js', | ||
'**/__tests__/**/*.ts', | ||
'**/__tests__/**/*.jsx', | ||
'**/__tests__/**/*.tsx', | ||
files: ['*.jsx'], | ||
extends: ['@react-hookz/eslint-config/base.cjs', '@react-hookz/eslint-config/react.cjs'], | ||
}, | ||
{ | ||
files: ['*.ts'], | ||
extends: ['@react-hookz/eslint-config/typescript.cjs'], | ||
}, | ||
{ | ||
files: ['*.tsx'], | ||
extends: [ | ||
'@react-hookz/eslint-config/typescript.cjs', | ||
'@react-hookz/eslint-config/react.cjs', | ||
], | ||
extends: ['@react-hookz/eslint-config/react', '@react-hookz/eslint-config/jest'], | ||
}, | ||
{ | ||
files: ['**/__docs__/**', '**/__tests__/**'], | ||
rules: { | ||
'@typescript-eslint/no-floating-promises': 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-unsafe-assignment': 'off', | ||
'@typescript-eslint/no-unsafe-member-access': 'off', | ||
'@typescript-eslint/no-unsafe-call': 'off', | ||
'@typescript-eslint/no-unsafe-argument': 'off', | ||
'@typescript-eslint/no-unsafe-return': 'off', | ||
'unicorn/consistent-function-scoping': 'off', | ||
'unicorn/no-this-assignment': 'off', | ||
}, | ||
files: ['**/__tests__/**/*.js'], | ||
extends: ['@react-hookz/eslint-config/base.cjs', '@react-hookz/eslint-config/jest.cjs'], | ||
}, | ||
{ | ||
files: ['**/__tests__/**/*.jsx'], | ||
extends: [ | ||
'@react-hookz/eslint-config/base.cjs', | ||
'@react-hookz/eslint-config/react.cjs', | ||
'@react-hookz/eslint-config/jest.cjs', | ||
], | ||
}, | ||
{ | ||
files: ['**/__tests__/**/*.ts'], | ||
extends: [ | ||
'@react-hookz/eslint-config/typescript-unsafe.cjs', | ||
'@react-hookz/eslint-config/jest.cjs', | ||
], | ||
}, | ||
{ | ||
files: ['**/__tests__/**/*.tsx'], | ||
extends: [ | ||
'@react-hookz/eslint-config/typescript-unsafe.cjs', | ||
'@react-hookz/eslint-config/react.cjs', | ||
'@react-hookz/eslint-config/jest.cjs', | ||
], | ||
}, | ||
{ | ||
files: ['*.md'], | ||
extends: ['@react-hookz/eslint-config/mdx'], | ||
extends: ['@react-hookz/eslint-config/md.cjs'], | ||
}, | ||
{ | ||
files: ['*.mdx'], | ||
extends: ['@react-hookz/eslint-config/mdx.cjs'], | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
const config = require("@react-hookz/eslint-config/.prettierrc.js"); | ||
const config = require('@react-hookz/eslint-config/.prettierrc.cjs'); | ||
|
||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
import { DocsContext, Source } from '@storybook/addon-docs'; | ||
import React, { FC, useContext } from 'react'; | ||
import React, { type FC, useContext } from 'react'; | ||
|
||
export interface ImportPathProps { | ||
root?: boolean; | ||
direct?: boolean; | ||
} | ||
export type ImportPathProps = { | ||
isRoot?: boolean; | ||
isDirect?: boolean; | ||
}; | ||
|
||
export const ImportPath: FC<ImportPathProps> = ({ root = true, direct = true }) => { | ||
export function ImportPath({ isRoot = true, isDirect = true }: ImportPathProps) { | ||
const context = useContext(DocsContext); | ||
// eslint-disable-next-line react/destructuring-assignment | ||
|
||
const componentName = context.title?.split('/')[1] || 'UnknownComponent'; | ||
|
||
const imports: string[] = []; | ||
|
||
if (root) { | ||
if (isRoot) { | ||
imports.push(`// root import\nimport { ${componentName} } from '@react-hookz/web';`); | ||
} | ||
|
||
if (direct) { | ||
if (isDirect) { | ||
imports.push( | ||
`// direct import\nimport { ${componentName} } from '@react-hookz/web/esm/${componentName}';` | ||
); | ||
} | ||
|
||
return <Source language="js" code={imports.join('\n')} />; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export const NavigatorVibrateSetup = () => { | ||
export const setupNavigatorVibrate = () => { | ||
navigator.vibrate = (() => true) as typeof navigator.vibrate; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.