Skip to content

Commit

Permalink
chore: upgrade to prettier@3 (#576)
Browse files Browse the repository at this point in the history
  • Loading branch information
redonkulus committed Jul 5, 2023
1 parent 7af1156 commit 3b65ac6
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 18 deletions.
6 changes: 4 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ module.exports = {
rules: {
'comma-dangle': 0,
'consistent-return': 0,
'default-param-last': 0,
'func-names': 0,
'max-len': [2, 120, 4],
'no-console': 0,
'no-continue': 0,
'no-func-assign': 0,
'no-param-reassign': 0,
Expand All @@ -21,11 +23,11 @@ module.exports = {
},
env: {
browser: true,
es6: true,
es2022: true,
jasmine: true,
jest: true,
node: true
},
plugins: ['import', 'react', 'react-hooks'],
parser: 'babel-eslint'
parser: '@babel/eslint-parser',
};
21 changes: 10 additions & 11 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,23 @@ name: Node.js CI

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]
node-version: [16.x, 18.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm i
- run: npm test
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm i
- run: npm test
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"func": "npm run dist && npm run dist-functional && grunt functional",
"func-debug": "npm run dist && npm run dist-functional && grunt functional-debug",
"lint": "eslint src",
"lint:fix": "eslint src --fix",
"prepublish": "npm run dist",
"test": "jest src --coverage --coverageReporters=lcov",
"unit": "jest src"
Expand All @@ -33,6 +34,7 @@
"devDependencies": {
"@babel/cli": "^7.8.4",
"@babel/core": "^7.9.6",
"@babel/eslint-parser": "^7.22.6",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.1",
"@babel/plugin-proposal-object-rest-spread": "^7.10.1",
Expand All @@ -42,13 +44,12 @@
"@babel/preset-react": "^7.9.4",
"@babel/register": "^7.9.0",
"@testing-library/react": "^14.0.0",
"babel-eslint": "^10.0.1",
"babel-loader": "^9.0.1",
"babel-plugin-dynamic-import-node": "^2.2.0",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"benchmark": "^2.1.3",
"es5-shim": "^4.5.12",
"eslint": "^8.2.0",
"eslint": "^8.44.0",
"eslint-config-airbnb": "^19.0.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-jsx-a11y": "^6.2.1",
Expand All @@ -71,7 +72,7 @@
"mocha": "^10.0.0",
"object-assign": "^4.0.0",
"pre-commit": "^1.0.0",
"prettier": "^2.0.5",
"prettier": "^3.0.0",
"promise": "^8.0.2",
"react": "^18.0.0",
"react-dom": "^18.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/core/ReactI13n.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class ReactI13n {
* @async
*/
execute = (eventName, payload, callback) => {
payload = Object.assign({}, payload);
payload = { ...payload };
payload.env = ENVIRONMENT;
payload.i13nNode = payload.i13nNode || this.getRootI13nNode();
const promiseHandlers = this.getEventHandlers(eventName, payload);
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useViewportDetect.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const useViewportDetect = ({
}) => {
const onEnterViewport = useCallback(() => {
node.setIsInViewport(true);
executeEvent?.('enterViewport', {i13nNode: node});
executeEvent?.('enterViewport', { i13nNode: node });
}, [executeEvent, node]);

const onLeaveViewport = useCallback(() => {
Expand Down

0 comments on commit 3b65ac6

Please sign in to comment.