Skip to content

Commit

Permalink
feat: types and linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver committed Feb 3, 2023
1 parent 1ac0553 commit 8c9fdda
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 24 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/
dist/
.eslintrc.js
.eslintrc.js
types/
4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'],
};
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ package-lock.json
# static folders
build/
dist/
types/

# System Files
.DS_Store
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -39,7 +39,7 @@
}
},
"lint-staged": {
"*.ts": [
"*.{ts,tsx}": [
"eslint --fix",
"prettier --write",
"git add"
Expand Down
6 changes: 2 additions & 4 deletions src/components/boiler-text-button/index.stories.tsx
Original file line number Diff line number Diff line change
@@ -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',
Expand All @@ -11,8 +11,6 @@ export default {
},
};

const BoilerTextButtonStory: Story = (args) => (
<BoilerTextButtonReact {...args}/>
);
const BoilerTextButtonStory: Story = (args) => <BoilerTextButtonReact {...args} />;
export const BoilerTextButton = BoilerTextButtonStory.bind({});
BoilerTextButton.storyName = 'BoilerTextButton';
15 changes: 15 additions & 0 deletions tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -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"],
}
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
"skipLibCheck": true
},
"include": ["src"],
"exclude": ["*.stories.*"]
"exclude": ["**/*.stories.tsx"]
}
10 changes: 0 additions & 10 deletions types/components/boiler-text-button/index.stories.d.ts

This file was deleted.

5 changes: 5 additions & 0 deletions types/components/boiler-text-button/indexReact.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { EventName } from '@lit-labs/react';
import { BoilerTextButton } from '.';
export declare const BoilerTextButtonReact: import("@lit-labs/react").ReactWebComponent<BoilerTextButton, {
onClick: EventName<PointerEvent>;
}>;

0 comments on commit 8c9fdda

Please sign in to comment.