Skip to content

Commit

Permalink
Rename JavaScript files to TypeScript files
Browse files Browse the repository at this point in the history
  • Loading branch information
radek.stary committed Apr 28, 2023
1 parent 6213b0a commit e8cf786
Show file tree
Hide file tree
Showing 260 changed files with 21,610 additions and 54,299 deletions.
32 changes: 21 additions & 11 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
{
"extends" : [
"@visionappscz/eslint-config-visionapps"
"extends": [
"@visionappscz/eslint-config-visionapps",
"airbnb-typescript",
"plugin:@typescript-eslint/recommended",
"plugin:typescript-sort-keys/recommended"
// "plugin:@typescript-eslint/recommended-requiring-type-checking"
],
"ignorePatterns": ["src/wasm/wasm.*"],
"env": {
"browser": true,
"jest": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"plugins": ["@typescript-eslint"],
"rules": {
"import/prefer-default-export": "off",
"react/default-props-match-prop-types": "off",
"no-console": ["error"],
"@typescript-eslint/object-curly-spacing": ["error"],
"@typescript-eslint/no-unused-vars": ["error"]
},
"overrides": [
{
"files": ["**/*.md", "**/*.mdx"],
"extends": [
"plugin:markdown/recommended",
"plugin:mdx/recommended"
]
"extends": ["plugin:markdown/recommended", "plugin:mdx/recommended"]
}
],
"parser": "@babel/eslint-parser",
"rules": {
"import/prefer-default-export": "off"
}
]
}
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';
30 changes: 30 additions & 0 deletions definitions.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
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';

// Test types

declare type AssertFn = (rootElement: HTMLElement) => void;

declare interface NonMandatoryProps {
[key: string]: unknown;
}

declare type TestingProps = [nonMandatoryProps, AssertFn];

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

0 comments on commit e8cf786

Please sign in to comment.