diff --git a/.eslintignore b/.eslintignore index 27a1d42cb..0533e6b8b 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,4 @@ node_modules/ dist/ -.eslintrc.js \ No newline at end of file +.eslintrc.js +types/ \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js index 7750fd3cd..bfe404311 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -4,7 +4,7 @@ module.exports = { // Specifies the ESLint parser parserOptions: { tsconfigRootDir: __dirname, - project: ['./tsconfig.json'], + project: ['./tsconfig.eslint.json'], ecmaVersion: 2022, // Allows for the parsing of modern ECMAScript features sourceType: 'module', // Allows for the use of imports @@ -27,5 +27,5 @@ module.exports = { '@typescript-eslint/no-unsafe-member-access': 'off', }, settings: {}, - ignorePatterns: ['utils/create-icons-index.mjs', 'figma-design-tokens'], + ignorePatterns: ['utils/create-icons-index.mjs', 'figma-design-tokens', 'types/', '*.svg', '*.scss', '*.css'], }; diff --git a/.prettierignore b/.prettierignore index 92306837d..2b568f432 100644 --- a/.prettierignore +++ b/.prettierignore @@ -13,6 +13,7 @@ package-lock.json # static folders build/ dist/ +types/ # System Files .DS_Store diff --git a/package.json b/package.json index 4160c7176..eb287e976 100644 --- a/package.json +++ b/package.json @@ -7,13 +7,13 @@ "commitlint": "commitlint -c -e", "start": "start-storybook -p 1337", "build": "NODE_ENV=production webpack --config webpack.prod.js", - "build:types": "tsc --emitDeclarationOnly", + "build:types": "rimraf types && tsc --emitDeclarationOnly", "lint": "npm run lint:eslint && npm run lint:prettier", "format": "npm run format:eslint && npm run format:prettier", - "lint:eslint": "eslint --ext .ts . --ignore-path .gitignore", - "format:eslint": "eslint --ext .ts . --fix --ignore-path .gitignore", - "lint:prettier": "prettier \"**/*.ts\" --check --ignore-path .gitignore", - "format:prettier": "prettier \"**/*.ts\" --write --ignore-path .gitignore", + "lint:eslint": "eslint 'src/**' --ext .ts,.tsx", + "format:eslint": "eslint 'src/**' --ext .ts,.tsx --fix", + "lint:prettier": "prettier \"**/*.{ts,tsx}\" --check", + "format:prettier": "prettier \"**/*.{ts,tsx}\" --write", "build-storybook": "build-storybook", "doc:install": "deven-documentation-skeleton install", "doc:check": "deven-documentation-skeleton check", @@ -39,7 +39,7 @@ } }, "lint-staged": { - "*.ts": [ + "*.{ts,tsx}": [ "eslint --fix", "prettier --write", "git add" diff --git a/src/components/boiler-text-button/index.stories.tsx b/src/components/boiler-text-button/index.stories.tsx index d575b273c..0ffc391ce 100644 --- a/src/components/boiler-text-button/index.stories.tsx +++ b/src/components/boiler-text-button/index.stories.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { Story } from '@storybook/react/types-6-0'; -import {BoilerTextButtonReact} from './indexReact'; +import { BoilerTextButtonReact } from './indexReact'; export default { title: 'BoilerTextButton', @@ -11,8 +11,6 @@ export default { }, }; -const BoilerTextButtonStory: Story = (args) => ( - -); +const BoilerTextButtonStory: Story = (args) => ; export const BoilerTextButton = BoilerTextButtonStory.bind({}); BoilerTextButton.storyName = 'BoilerTextButton'; diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json new file mode 100644 index 000000000..c78718eb3 --- /dev/null +++ b/tsconfig.eslint.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "moduleResolution": "node", + "noImplicitAny": true, + "allowSyntheticDefaultImports": true, + "sourceMap": true, + "module": "es6", + "target": "es5", + "jsx": "react", + "allowJs": true, + "experimentalDecorators": true, + "skipLibCheck": true + }, + "include": ["src"], +} diff --git a/tsconfig.json b/tsconfig.json index 0d9ef18d4..da3e6fe6e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,5 +14,5 @@ "skipLibCheck": true }, "include": ["src"], - "exclude": ["*.stories.*"] + "exclude": ["**/*.stories.tsx"] } diff --git a/types/components/boiler-text-button/index.stories.d.ts b/types/components/boiler-text-button/index.stories.d.ts deleted file mode 100644 index 214059772..000000000 --- a/types/components/boiler-text-button/index.stories.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -declare const _default: { - title: string; - args: { - label: string; - onClick: () => void; - icon: string; - }; -}; -export default _default; -export declare const BoilerTextButtonTest: any; diff --git a/types/components/boiler-text-button/indexReact.d.ts b/types/components/boiler-text-button/indexReact.d.ts new file mode 100644 index 000000000..aca007f9e --- /dev/null +++ b/types/components/boiler-text-button/indexReact.d.ts @@ -0,0 +1,5 @@ +import { EventName } from '@lit-labs/react'; +import { BoilerTextButton } from '.'; +export declare const BoilerTextButtonReact: import("@lit-labs/react").ReactWebComponent; +}>;