Skip to content

Commit

Permalink
style: allow unsed React imports (we still need it to support <18) and
Browse files Browse the repository at this point in the history
require \`type\` for type imports
  • Loading branch information
nerdyman committed May 10, 2022
1 parent 5817bb0 commit 3e13d19
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.nyc/
node_modules/
dist/
*.ignore
6 changes: 4 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@
"react/jsx-indent-props": 0,
"react/prop-types": 0,

"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/no-unused-vars": [
"warn",
{
"args": "all",
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
// Although this repo uses React 18 the library supports React 16+ so we still need to import React.
"argsIgnorePattern": "^(_|React)",
"varsIgnorePattern": "^(_|React)"
}
],
"@typescript-eslint/no-use-before-define": "warn"
Expand Down
3 changes: 2 additions & 1 deletion example/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ReactImageTurntable, ReactImageTurntableProps } from 'react-image-turntable';
import { ReactImageTurntable } from 'react-image-turntable';
import type { ReactImageTurntableProps } from 'react-image-turntable';

export const images = [
'https://static2.zerolight.com/web/df3a45687480167bb4451d79c02f67bd/img/2d-explorer/bmw/P0C1G__S022B__FX3A9/P0C1G__S022B__FX3A9__Spin_01.jpg?v=1',
Expand Down
3 changes: 2 additions & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { PlaywrightTestConfig, devices } from '@playwright/test';
import { devices } from '@playwright/test';
import type { PlaywrightTestConfig } from '@playwright/test';

const config: PlaywrightTestConfig = {
forbidOnly: !!process.env.CI,
Expand Down
4 changes: 2 additions & 2 deletions src/ReactImageTurntable.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import type { FC } from 'react';
import type { CSSProperties, FC } from 'react';

import { useTurntableState } from './hooks';
import type { ReactImageTurntableFullProps } from './types';
Expand Down Expand Up @@ -29,7 +29,7 @@ export const ReactImageTurntable: FC<ReactImageTurntableFullProps> = ({
movementSensitivity,
});

const rootStyle: React.CSSProperties = {
const rootStyle: CSSProperties = {
position: 'relative',
touchAction: 'none',
userSelect: 'none',
Expand Down

0 comments on commit 3e13d19

Please sign in to comment.