Skip to content

Commit

Permalink
Update pacakges (#939)
Browse files Browse the repository at this point in the history
* update development tools

* version up astro

* upgrade react, astro, typescript, glob, etc.

* upgrade eslint 9.x

* update prettier

* fix glob type

* fix eslint config
  • Loading branch information
kamijin-fanta committed May 1, 2024
1 parent ef2c902 commit ad5e9f6
Show file tree
Hide file tree
Showing 16 changed files with 3,547 additions and 8,266 deletions.
14 changes: 0 additions & 14 deletions .eslintignore

This file was deleted.

20 changes: 0 additions & 20 deletions .eslintrc.yml

This file was deleted.

51 changes: 51 additions & 0 deletions eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
const js = require("@eslint/js");
const typescriptEslintParser = require("@typescript-eslint/parser");
const tseslint = require("typescript-eslint");
const ts = require("@typescript-eslint/eslint-plugin");
const globals = require("globals");
// const reactRecommended = require('eslint-plugin-react/configs/recommended');

module.exports = [
js.configs.recommended,
...tseslint.configs.recommended,
// reactRecommended, // eslint-plugin-react is not supported eslint 9.x
{
plugins: {
"@typescript-eslint": ts,
},
languageOptions: {
globals: {
...globals.browser,
...globals.node,
...globals.jest,
},
parser: typescriptEslintParser,
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
},
rules: {
"@typescript-eslint/no-var-requires": 0,
"react/prop-types": 0,
},
files: ["**/*.{js,mjs,cjs,ts,tsx}"],
},
{
ignores: [
"node_modules",
"**/node_modules",
".yarn/",
"**/.git/",
"**/build/",
"**/docs/",
"**/dist/",
"packages/react-icons/lib/**/*",
"packages/react-icons/build/**/*",
"packages/react-icons/icons/**/*",
"!packages/react-icons/icons/index.js",
"packages/_react-icons_all/**/*",
"packages/_react-icons_all-files/**/*",
],
},
];
17 changes: 10 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,19 @@
],
"license": "MIT",
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.40.0",
"@typescript-eslint/parser": "^5.40.0",
"eslint": "^8.25.0",
"eslint-plugin-react": "latest",
"@eslint/js": "^9.1.1",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"eslint": "^9.1.1",
"eslint-plugin-react": "^7.34.1",
"globals": "^15.1.0",
"lerna": "^8.1.2",
"prettier": "^3.0.3",
"prettier-plugin-astro": "^0.12.1"
"prettier": "^3.2.5",
"prettier-plugin-astro": "^0.13.0",
"typescript-eslint": "^7.8.0"
},
"scripts": {
"lint": "yarn eslint .",
"lint": "yarn eslint",
"format": "prettier --write --ignore-unknown '**/*.{js,ts,mjs,cjs,json,astro}'",
"format:ci": "prettier --check --ignore-unknown '**/*.{js,ts,mjs,cjs,json,astro}'",
"version-up": "lerna version",
Expand Down
8 changes: 4 additions & 4 deletions packages/demo-all-files/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "5.1.1-snapshot.0",
"private": true,
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.1.1-snapshot.0",
"react-scripts": "^5.0.1"
},
Expand All @@ -16,8 +16,8 @@
},
"devDependencies": {
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.2",
"enzyme-to-json": "^3.4.3"
"enzyme-adapter-react-16": "^1.15.8",
"enzyme-to-json": "^3.6.2"
},
"resolutions": {
"@types/cheerio": "npm:empty-npm-package"
Expand Down
8 changes: 4 additions & 4 deletions packages/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "5.1.1-snapshot.0",
"private": true,
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.1.1-snapshot.0",
"react-scripts": "^5.0.1"
},
Expand All @@ -16,8 +16,8 @@
},
"devDependencies": {
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.2",
"enzyme-to-json": "^3.4.3"
"enzyme-adapter-react-16": "^1.15.8",
"enzyme-to-json": "^3.6.2"
},
"resolutions": {
"@types/cheerio": "npm:empty-npm-package"
Expand Down
16 changes: 8 additions & 8 deletions packages/preview-astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/check": "^0.3.1",
"@astrojs/react": "^3.0.4",
"@nanostores/react": "^0.7.1",
"astro": "^3.4.3",
"@astrojs/check": "^0.5.10",
"@astrojs/react": "^3.3.1",
"@nanostores/react": "^0.7.2",
"astro": "^4.7.0",
"basscss": "^8.1.0",
"cogo-toast": "^4.2.3",
"copy-to-clipboard": "^3.3.3",
"nanostores": "^0.9.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"nanostores": "^0.10.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.1.1-snapshot.0",
"sass": "^1.69.5",
"tiny-skeleton-loader-react": "^1.2.1",
"typescript": "^5.2.2"
"typescript": "^5.4.5"
}
}
1 change: 1 addition & 0 deletions packages/preview-astro/src/env.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// /// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client" />

declare module "virtual:react-icons-get-icons" {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-icons/VERSIONS
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
| [Typicons](http://s-ings.com/typicons/) | [CC BY-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/) | 2.1.2 | 336 |
| [Github Octicons icons](https://octicons.github.com/) | [MIT](https://github.com/primer/octicons/blob/master/LICENSE) | 18.3.0 | 264 |
| [Feather](https://feathericons.com/) | [MIT](https://github.com/feathericons/feather/blob/master/LICENSE) | 4.29.1 | 287 |
| [Lucide](https://lucide.dev/) | [ISC](https://github.com/lucide-icons/lucide/blob/main/LICENSE) | v5.1.0-2-gd8563176 | 1215 |
| [Lucide](https://lucide.dev/) | [ISC](https://github.com/lucide-icons/lucide/blob/main/LICENSE) | v5.1.0-6-g438f572e | 1215 |
| [Game Icons](https://game-icons.net/) | [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/) | 12920d6565588f0512542a3cb0cdfd36a497f910 | 4040 |
| [Weather Icons](https://erikflowers.github.io/weather-icons/) | [SIL OFL 1.1](http://scripts.sil.org/OFL) | 2.0.12 | 219 |
| [Devicons](https://vorillaz.github.io/devicons/) | [MIT](https://opensource.org/licenses/MIT) | 1.8.0 | 192 |
Expand Down
30 changes: 14 additions & 16 deletions packages/react-icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,29 @@
"react": "*"
},
"devDependencies": {
"@babel/cli": "^7.19.3",
"@babel/core": "^7.19.3",
"@babel/preset-env": "^7.23.6",
"@babel/preset-react": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@babel/cli": "^7.24.5",
"@babel/core": "^7.24.5",
"@babel/preset-env": "^7.24.5",
"@babel/preset-react": "^7.24.1",
"@babel/preset-typescript": "^7.24.1",
"@primer/octicons": "^18.3.0",
"@types/node": "^20.9.0",
"@types/react": "^18.0.21",
"@types/node": "^20.12.7",
"@types/react": "^18.3.1",
"babel-plugin-add-import-extension": "^1.6.0",
"camelcase": "^7.0.0",
"camelcase": "^8.0.0",
"cheerio": "^1.0.0-rc.12",
"esbuild": "^0.15.11",
"esbuild-register": "^3.3.3",
"esbuild": "^0.20.2",
"esbuild-register": "^3.5.0",
"feather-icons": "^4.7.3",
"find-package": "^1.0.0",
"glob": "^8.0.3",
"glob-promise": "^5.0.0",
"glob": "^8.1.0",
"glob-promise": "^6.0.5",
"ionicons": "^4.6.3",
"ionicons-5": "npm:ionicons@5",
"lerna": "^3.20.2",
"lucide-static": "^0.263.0",
"p-queue": "^7.3.0",
"prettier": "^2.7.1",
"p-queue": "^8.0.1",
"svgo": "^3.0.3",
"typescript": "^4.8.4"
"typescript": "^5.4.5"
},
"scripts": {
"ts": "node -r esbuild-register",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-icons/scripts/task_all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ export async function dirInit({ DIST, LIB, rootDir }: TaskContext) {
await write([file], "// THIS FILE IS AUTO GENERATED\n");
}
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export async function writeIconModule(
icon: IconDefinition,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
{ DIST, LIB, rootDir }: TaskContext,
) {
const exists = new Set(); // for remove duplicate
Expand Down
2 changes: 1 addition & 1 deletion packages/react-icons/scripts/task_common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ export async function writeIconVersions({ DIST, LIB, rootDir }: TaskContext) {
await fs.writeFile(path.resolve(rootDir, "VERSIONS"), versionsStr, "utf8");
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export async function writePackageJson(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
override: any,
{ DIST, LIB, rootDir }: TaskContext,
) {
Expand Down
7 changes: 3 additions & 4 deletions packages/react-icons/src/iconBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ function Tree2Element(tree: IconTree[]): React.ReactElement[] {
React.createElement(
node.tag,
{ key: i, ...node.attr },
Tree2Element(node.child)
)
Tree2Element(node.child),
),
)
);
}
export function GenIcon(data: IconTree) {
// eslint-disable-next-line react/display-name
return (props: IconBaseProps) => (
<IconBase attr={{ ...data.attr }} {...props}>
{Tree2Element(data.child)}
Expand All @@ -38,7 +37,7 @@ export interface IconBaseProps extends React.SVGAttributes<SVGElement> {

export type IconType = (props: IconBaseProps) => JSX.Element;
export function IconBase(
props: IconBaseProps & { attr?: Record<string, string> }
props: IconBaseProps & { attr?: Record<string, string> },
): JSX.Element {
const elem = (conf: IconContext) => {
const { attr, size, title, ...svgProps } = props;
Expand Down
19 changes: 7 additions & 12 deletions packages/ts-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,22 @@
"version": "5.1.1-snapshot.0",
"private": true,
"dependencies": {
"@types/jest": "29.1.2",
"@types/node": "18.8.5",
"@types/react": "^18.0.21",
"@types/react-dom": "^18.0.6",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"@types/jest": "29.5.12",
"@types/node": "18.19.31",
"@types/react": "^18.3.1",
"@types/react-dom": "^18.3.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.1.1-snapshot.0",
"react-scripts": "5.0.1",
"typescript": "4.8.4"
"typescript": "5.4.5"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"plugins": [
"react"
]
},
"browserslist": {
"production": [
">0.2%",
Expand Down
1 change: 0 additions & 1 deletion packages/ts-test/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ import { createRoot } from "react-dom/client";
import "./index.css";
import App from "./App";

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
createRoot(document.getElementById("root")!).render(<App />);

0 comments on commit ad5e9f6

Please sign in to comment.