Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Commit

Permalink
fix critical (#222)
Browse files Browse the repository at this point in the history
* fix npm

* fix critical

* fix eslint mdx

* force upgrade

* fix ci

* fix storybook

* fix eslintrc

* fix some jsx issue

* fix : eslint upgrade to 8

* added jest fix

* fix: emotion core

* remove old babel

* split babelrc

* fix css

* fix: typecheck

* fix: remove babel preset from webpack

Co-authored-by: David <david_tjokroaminoto@tech.gov.sg>
  • Loading branch information
dchocoboo and David committed Dec 14, 2022
1 parent adf582c commit d72c1ee
Show file tree
Hide file tree
Showing 12 changed files with 28,456 additions and 27,766 deletions.
73 changes: 73 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"parser": "@typescript-eslint/parser",
"env": {
"browser": true,
"jest": true,
"es2020": true
},
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:prettier/recommended"
],
"plugins": ["react-hooks", "@typescript-eslint"],
"parserOptions": {
"project": "./tsconfig.json",
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
"react/no-unknown-property": ["error", { "ignore": ["css"] }],
"@typescript-eslint/explicit-function-return-type": [
"warn",
{
"allowExpressions": true,
"allowTypedFunctionExpressions": true
}
],
"@typescript-eslint/no-explicit-any": "off",
"react/prop-types": "off",
"react/self-closing-comp": "error",
"array-callback-return": "error",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "error",
"prettier/prettier": [
1,
{
"endOfLine": "auto"
}
]
},
"overrides": [
{
"files": ["*.md"],
"rules": {
"prettier/prettier": [
2,
{
"parser": "markdown"
}
]
}
},
{
"files": ["*.mdx"],
"extends": ["plugin:mdx/overrides", "plugin:mdx/recommended"]
},
{
"files": ["*.test.ts", "*.test.tsx"],
"extends": ["plugin:jest/all"],
"rules": {
"jest/prefer-expect-assertions": "off"
}
}
]
}
7 changes: 4 additions & 3 deletions .github/workflows/ci-pull-request-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ jobs:
runs-on: ubuntu-latest
name: Tests
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "14.x"
- run: npm install
- run: npm install -g npm@9
- run: npm ci
- run: npm run lint
- run: npm run check-types
- run: npm run test
5 changes: 3 additions & 2 deletions .github/workflows/dependency-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ jobs:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm i -g npm@9
- run: npm ci
- uses: GovTechSG/dependency-check-action@v2.0.0
env:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ yarn.lock
dist
*.iml
.idea
docs/*
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
legacy-peer-deps=true
engine-strict=true
1 change: 0 additions & 1 deletion .storybook/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ module.exports = ({ config }) => {
}),
require.resolve("@babel/preset-typescript"),
require.resolve("@babel/preset-react"),
require.resolve("@emotion/babel-preset-css-prop"),
];

config.module.rules.push(
Expand Down
2 changes: 1 addition & 1 deletion application/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
FrameConnector,
HostActionsHandler,
} from "@govtechsg/decentralized-renderer-react-components";
import { css } from "@emotion/core";
import { css } from "@emotion/css";
import styled from "@emotion/styled";

interface AppProps {
Expand Down
19 changes: 19 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "current"
}
}
],
"@babel/preset-typescript",
"@babel/preset-react"
],
"plugins": [
"@babel/plugin-proposal-nullish-coalescing-operator",
"@babel/plugin-proposal-optional-chaining",
"@emotion"
]
}

0 comments on commit d72c1ee

Please sign in to comment.