Skip to content

Enforce consistent type imports via @typescript-eslint/consistent-type-imports #155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ rules:
"@typescript-eslint/no-unused-vars":
- 2
- varsIgnorePattern: ^_
"@typescript-eslint/consistent-type-imports": "error"
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16.x
node-version: 18.20.2
- run: yarn install --frozen-lockfile
- run: yarn run validate-change
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.14.0
18.20.2
23 changes: 14 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
"test:unit": "jest",
"lint": "eslint --max-warnings=0 '{src,examples}/**/*.{ts,tsx,js}'",
"lint:prettier": "prettier './**/*.js' './**/*.ts' './**/*.tsx' './**/*.md' --list-different",
"lint-fix": "eslint '{src,types}/**/*.{ts,js}' --fix && yarn prettier",
"typecheck": "tsc",
"build": "yarn run clean && yarn run rollup -c",
"checkimport": "scripts/check-imports",
"clean": "rimraf dist",
"prettier": "prettier './**/*.js' './**/*.ts' './**/*.tsx' './**/*.md' --write",
"prettier-check": "prettier './**/*.{js,ts,md,html,css}' --check",
"doctoc": "doctoc README.md",
"storybook": "start-storybook -p 6006 ",
"local-install-publish": "yalc add @stripe/connect-js@1.0.0 && yalc publish",
Expand Down Expand Up @@ -53,18 +55,21 @@
"@types/jest": "^24.0.25",
"@types/react": "^16.8.0",
"@types/react-dom": "^16.8.0",
"@typescript-eslint/eslint-plugin": "^4.15.2",
"@typescript-eslint/parser": "^4.15.2",
"@typescript-eslint/eslint-plugin": "^7",
"@typescript-eslint/parser": "^7",
"@typescript-eslint/rule-tester": "^7",
"@typescript-eslint/scope-manager": "^7",
"@typescript-eslint/utils": "^7",
"babel-eslint": "^10.0.3",
"babel-jest": "^24.9.0",
"conditional-type-checks": "^1.0.5",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.8.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jest": "^22.6.3",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint": "8.56.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-jest": "^26.6.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.36.1",
"eslint-plugin-react-hooks": "5.2.0-canary-7b402084-20250107",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"jsdom": "^22.0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/Components.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {useCreateComponent} from './useCreateComponent';
import {useUpdateWithSetter} from './utils/useUpdateWithSetter';
import {
import type {
CollectionOptions,
FetchEphemeralKeyFunction,
FinancingProductType,
FinancingPromotionLayoutType,
} from './types';
import {
import type {
LoadError,
LoaderStart,
NotificationCount,
Expand Down
2 changes: 1 addition & 1 deletion src/ConnectComponents.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import * as connectJs from '@stripe/connect-js';
import type * as connectJs from '@stripe/connect-js';

type ConnectComponentsPayload = {
connectInstance: connectJs.StripeConnectInstance;
Expand Down
2 changes: 1 addition & 1 deletion src/useCreateComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable react-hooks/exhaustive-deps */
import * as React from 'react';
import {useConnectComponents} from './ConnectComponents';
import {
import type {
ConnectElementTagName,
ConnectHTMLElementRecord,
} from '@stripe/connect-js';
Expand Down
2 changes: 1 addition & 1 deletion src/utils/useAttachAttribute.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

/**
* @deprecated The method should not be used as we are deprecating the use of attributes directly.
* @deprecated The method should not be used as we are deprecating the use of attributes directly.
* Define a setter for your use case and use useUpdateWithSetter instead.
*/
export const useAttachAttribute = (
Expand Down
4 changes: 2 additions & 2 deletions src/utils/useUpdateWithSetter.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react';
import {
import type {
CollectionOptions,
FetchEphemeralKeyFunction,
FinancingProductType,
} from '../types';
import {
import type {
LoadError,
LoaderStart,
InstallState,
Expand Down
Loading