-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial refactor * More changes * Updating jest, ts-jest * Fixing eslint * Adding jest-environment-jsdom * Updating workflows * Lint * Prettier lint * Limiting eslint * More codestyle * More eslint config
- Loading branch information
Showing
50 changed files
with
10,350 additions
and
23,384 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module.exports = { | ||
parser: '@typescript-eslint/parser', // Specifies the ESLint parser | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:react/recommended', | ||
'plugin:react-hooks/recommended', | ||
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin | ||
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array. | ||
], | ||
parserOptions: { | ||
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features | ||
sourceType: 'module', // Allows for the use of imports | ||
ecmaFeatures: { | ||
jsx: true, // Allows for the parsing of JSX | ||
}, | ||
}, | ||
rules: { | ||
'react/display-name': 0, | ||
'no-unused-vars': 'off', | ||
'react/prop-types': 'off', | ||
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], | ||
}, | ||
settings: { | ||
react: { | ||
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
presets: ['@babel/preset-env'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// In your own jest-setup.js (or any other name) | ||
import '@testing-library/jest-dom/extend-expect'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
module.exports = { | ||
testEnvironment: 'jsdom', | ||
preset: 'ts-jest/presets/js-with-babel', | ||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], | ||
testMatch: ['<rootDir>/test/**/*.spec.(ts|tsx)'], | ||
collectCoverageFrom: ['./src/**/*.{ts,tsx}', '!**/node_modules/**', '!./test/**'], | ||
collectCoverage: false, | ||
coverageThreshold: { | ||
global: { | ||
branches: 50, | ||
functions: 15, | ||
lines: 50, | ||
statements: -520, | ||
}, | ||
}, | ||
transformIgnorePatterns: ['/node_maodules/(?!tubular-common)'], | ||
transform: { | ||
'^.+\\.(ts|tsx)$': 'ts-jest', | ||
'^.+\\.(js)$': 'babel-jest', | ||
}, | ||
automock: false, | ||
setupFilesAfterEnv: ['./jest-setup.ts'], | ||
setupFiles: ['@testing-library/react/dont-cleanup-after-each'], | ||
globals: { | ||
'ts-jest': { | ||
diagnostics: false, | ||
tsconfig: 'tsconfig.json', | ||
}, | ||
}, | ||
}; |
Oops, something went wrong.