Skip to content
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

Transform typescript #463

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
50 changes: 36 additions & 14 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,22 +1,44 @@
{
"extends" : [
"@visionappscz/eslint-config-visionapps"
],
"env": {
"browser": true,
"jest": true
},
"overrides": [
{
"files": ["**/*.md", "**/*.mdx"],
"extends": ["plugin:markdown/recommended", "plugin:mdx/recommended"],
"rules": {
"@typescript-eslint/*": "off"
}
},
{
"files": ["**/*.js"],
"extends": ["@visionappscz/eslint-config-visionapps"],
"parser": "@babel/eslint-parser",
"rules": {
"@typescript-eslint/*": "off"
}
},
{
"files": ["**/*.ts", "**/*.tsx"],
"extends": [
"plugin:markdown/recommended",
"plugin:mdx/recommended"
]
"@visionappscz/eslint-config-visionapps",
"airbnb-typescript",
"plugin:@typescript-eslint/recommended",
"plugin:typescript-sort-keys/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json"
},
"plugins": ["@typescript-eslint"],
"rules": {
"@typescript-eslint/no-unused-vars": ["error"],
"@typescript-eslint/object-curly-spacing": ["error"],
"import/prefer-default-export": ["off"],
"no-console": ["error"],
"react/default-props-match-prop-types": ["off"]
}
}
],
"parser": "@babel/eslint-parser",
"rules": {
"import/prefer-default-export": "off"
"env": {
"browser": true,
"jest": true
}
}
}
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ postcss.config.js
RELEASING.md
stylelint.config.js
webpack.config.js
tsconfig.json
2 changes: 2 additions & 0 deletions declaration.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare module '*.css';
declare module '*.scss';
26 changes: 26 additions & 0 deletions definitions.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
declare type Color = 'primary' | 'secondary' | 'selected' | 'success' | 'warning' | 'danger' | 'help' | 'info' | 'note' | 'light' | 'dark';
declare type Scrolling = 'auto' | 'custom' | 'none';
declare type Type = 'button' | 'submit';
declare type Align = 'top' | 'middle' | 'bottom' | 'baseline';
declare type Justify = 'start' | 'center' | 'end' | 'space-between' | 'stretch';
declare type InputType = 'email' | 'number' | 'password' | 'tel' | 'text';
declare type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'x2l' | 'x3l' | 'none';
declare type Priority = 'filled' | 'outline' | 'flat';
declare type Size = 'small' | 'medium' | 'large';
declare type Position = 'before' | 'after';
declare type Validation = 'invalid' | 'valid' | 'warning';
declare type Layout = 'horizontal' | 'vertical';
declare type Placement = 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end';
declare type AutoScroll = 'always' | 'detectEnd' | 'off';
declare type Direction = 'asc' | 'desc';
declare type Hyphens = 'none' | 'auto' | 'manual';
declare type WordWrapping = 'normal' | 'long-words' | 'anywhere';
declare type VerticalModalPosition = 'top' | 'center';
declare type PredefinedLabelWidthValues = 'auto' | 'default' | 'limited';

declare type AssertFn = (rootElement: HTMLElement) => void;
declare interface NonMandatoryProps {
[key: string]: unknown;
}
declare type TestingProps = [nonMandatoryProps, AssertFn];

23 changes: 9 additions & 14 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
module.exports = {
moduleFileExtensions: [
'js',
'jsx',
],
moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx'],
moduleNameMapper: {
'\\.scss$': 'identity-obj-proxy',
},
modulePathIgnorePatterns: [
'<rootDir>/.docz/',
],
setupFiles: [
'<rootDir>/tests/setupJest.js',
],
setupFilesAfterEnv: [
'<rootDir>/tests/setupTestingLibrary.js',
],
modulePathIgnorePatterns: ['<rootDir>/.docz/'],
preset: 'ts-jest',
setupFiles: ['<rootDir>/tests/setupJest.ts'],
setupFilesAfterEnv: ['<rootDir>/tests/setupTestingLibrary.ts'],
testEnvironment: 'jsdom',
transform: {
'^.+\\.(t|j)sx?$': 'ts-jest',
},
verbose: true,
};
};
Loading