Skip to content

Commit

Permalink
Update packages && use ts
Browse files Browse the repository at this point in the history
  • Loading branch information
vadymshymko committed May 2, 2022
1 parent 94eaae4 commit 4752780
Show file tree
Hide file tree
Showing 10 changed files with 2,579 additions and 2,981 deletions.
18 changes: 7 additions & 11 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,19 @@
"es2021": true,
"node": true
},
"extends": [
"plugin:react/recommended",
"airbnb",
"plugin:react-hooks/recommended",
"prettier",
"prettier/react"
],
"parser": "babel-eslint",
"extends": ["plugin:react/recommended", "airbnb", "prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["react"],
"plugins": ["react", "@typescript-eslint"],
"rules": {
"import/no-extraneous-dependencies": ["error", { "devDependencies": true }]
"react/require-default-props": "off",
"react/jsx-props-no-spreading": "off",
"react/jsx-filename-extension": [1, { "extensions": [".tsx", ".jsx"] }]
}
}
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
4 changes: 4 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "es5"
}
20 changes: 13 additions & 7 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
module.exports = {
presets: ["@babel/preset-env", "@babel/preset-react"],
plugins: [
presets: [
[
"transform-react-remove-prop-types",
'@babel/preset-env',
{
removeImport: true,
additionalLibraries: ["prop-types"],
useBuiltIns: 'entry',
corejs: 3,
},
],

["transform-remove-console", { exclude: ["error", "warn"] }],
'@babel/preset-react',
// [
// '@babel/preset-typescript',
// {
// isTSX: true,
// allExtensions: true,
// },
// ],
],
plugins: [['transform-remove-console', { exclude: ['error', 'warn'] }]],
};
79 changes: 34 additions & 45 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,10 @@
"sideEffects": false,
"scripts": {
"build": "webpack --mode=production",
"build:ts": "tsc",
"build:dev": "webpack --mode=development",
"lint": "eslint --ext .js,.jsx --fix && prettier --write .",
"prepublish": "npm run lint && npm run build"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.jsx": [
"eslint --fix",
"prettier --write"
],
"*.js": [
"eslint --fix",
"prettier --write"
]
"prepare": "husky install"
},
"keywords": [
"react",
Expand All @@ -53,40 +39,43 @@
},
"homepage": "https://github.com/vadymshymko/react-simply-carousel#readme",
"devDependencies": {
"@babel/cli": "^7.12.10",
"@babel/core": "^7.12.10",
"@babel/preset-env": "^7.12.11",
"@babel/preset-react": "^7.12.10",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.2.2",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"@babel/cli": "^7.17.10",
"@babel/core": "^7.17.10",
"@babel/preset-env": "^7.17.10",
"@babel/preset-react": "^7.16.7",
"@babel/preset-typescript": "^7.16.7",
"@types/react": "^18.0.8",
"@typescript-eslint/eslint-plugin": "^5.21.0",
"@typescript-eslint/parser": "^5.21.0",
"babel-loader": "^8.2.5",
"babel-plugin-transform-remove-console": "^6.9.4",
"clean-webpack-plugin": "^3.0.0",
"eslint": "^7.16.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-prettier": "^7.1.0",
"eslint-import-resolver-webpack": "^0.13.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-webpack-plugin": "^2.4.1",
"husky": "^4.3.6",
"lint-staged": "^10.5.3",
"path": "^0.12.7",
"prettier": "^2.2.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"webpack": "^5.11.1",
"webpack-bundle-analyzer": "^4.3.0",
"webpack-cli": "^4.3.0"
"eslint": "^8.14.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-react": "^7.29.4",
"eslint-plugin-react-hooks": "^4.5.0",
"husky": ">=6",
"lint-staged": ">=10",
"prettier": "2.6.2",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"typescript": "^4.6.4",
"webpack": "^5.72.0",
"webpack-bundle-analyzer": "^4.5.0",
"webpack-cli": "^4.9.2"
},
"dependencies": {
"core-js": "^3.8.1",
"prop-types": "^15.7.2"
"core-js": "^3.8.1"
},
"peerDependencies": {
"react": "^16.8 || ^17",
"react-dom": "^16.8 || ^17"
"react": "^16.8 || ^17 || ^18",
"react-dom": "^16.8 || ^17 || ^18"
},
"lint-staged": {
"*.{js,jsx,tsx}": "eslint --cache --fix",
".": "prettier --write"
}
}
Loading

0 comments on commit 4752780

Please sign in to comment.