Skip to content

Commit

Permalink
Refactor fabric columns (#645)
Browse files Browse the repository at this point in the history
* 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
kadosh authored Oct 5, 2024
1 parent b7fb4bf commit 4812cc9
Show file tree
Hide file tree
Showing 50 changed files with 10,350 additions and 23,384 deletions.
25 changes: 0 additions & 25 deletions .eslintrc

This file was deleted.

28 changes: 28 additions & 0 deletions .eslintrc.js
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
},
},
};
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:
jobs:
build:
uses: unosquare/bump-npm-version/.github/workflows/build-sonar.yml@master
with:
node-version: '18.20.4'
secrets:
github-token: ${{ secrets.GPR_ACCESS_TOKEN }}
sonar-token: ${{ secrets.SONAR_TOKEN }}
2 changes: 2 additions & 0 deletions .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ on:
jobs:
build:
uses: unosquare/bump-npm-version/.github/workflows/lint.yml@master
with:
node-version: '18.20.4'
secrets:
github-token: ${{ secrets.GPR_ACCESS_TOKEN }}
2 changes: 2 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
jobs:
publish:
uses: unosquare/bump-npm-version/.github/workflows/publish-public.yml@master
with:
node-version: '18.20.4'
secrets:
github-token: ${{ secrets.GPR_ACCESS_TOKEN }}
npm-token: ${{ secrets.NPM_TOKEN }}
3 changes: 3 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: ['@babel/preset-env'],
};
2 changes: 2 additions & 0 deletions jest-setup.ts
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';
30 changes: 30 additions & 0 deletions jest.config.js
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',
},
},
};
Loading

0 comments on commit 4812cc9

Please sign in to comment.