chore: update package version to 1.3.0 and modify dependencies
feat: add copyright notice to hooks and index files fix: update test imports to use @testing-library/react refactor: change TypeScript target from es5 to es6 chore: add ESLint configuration for TypeScript and Reactmaster
parent
d7d107cb1c
commit
75a40aba1f
32
.eslintrc
32
.eslintrc
|
@ -1,32 +0,0 @@
|
||||||
{
|
|
||||||
"root": true,
|
|
||||||
"extends": [
|
|
||||||
"prettier",
|
|
||||||
"plugin:prettier/recommended",
|
|
||||||
"eslint:recommended",
|
|
||||||
"plugin:react/recommended",
|
|
||||||
"plugin:@typescript-eslint/eslint-recommended",
|
|
||||||
"plugin:@typescript-eslint/recommended"
|
|
||||||
],
|
|
||||||
"parser": "@typescript-eslint/parser",
|
|
||||||
"plugins": ["@typescript-eslint", "prettier", "react", "react-hooks"],
|
|
||||||
"rules": {
|
|
||||||
"react-hooks/rules-of-hooks": "error",
|
|
||||||
"react-hooks/exhaustive-deps": "warn",
|
|
||||||
"@typescript-eslint/no-non-null-assertion": "off",
|
|
||||||
"@typescript-eslint/ban-ts-comment": "off",
|
|
||||||
"@typescript-eslint/no-explicit-any": "off"
|
|
||||||
},
|
|
||||||
"settings": {
|
|
||||||
"react": {
|
|
||||||
"version": "detect"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"env": {
|
|
||||||
"browser": true,
|
|
||||||
"node": true
|
|
||||||
},
|
|
||||||
"globals": {
|
|
||||||
"JSX": true
|
|
||||||
}
|
|
||||||
}
|
|
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2023 Tudor Stanciu
|
Copyright (c) 2022 Tudor Stanciu
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
a copy of this software and associated documentation files (the
|
a copy of this software and associated documentation files (the
|
||||||
|
|
|
@ -49,6 +49,11 @@ npm test
|
||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
|
### 1.3.0
|
||||||
|
|
||||||
|
- Upgraded dependencies to their latest versions.
|
||||||
|
- Refactored codebase to use ES6 modules and syntax.
|
||||||
|
|
||||||
### v1.2.0
|
### v1.2.0
|
||||||
|
|
||||||
- Rebranded the package from `react-hooks` to `lumrop`.
|
- Rebranded the package from `react-hooks` to `lumrop`.
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
import eslint from "@eslint/js";
|
||||||
|
import tseslint from "typescript-eslint";
|
||||||
|
import globals from "globals";
|
||||||
|
import react from "eslint-plugin-react";
|
||||||
|
import reactHooks from "eslint-plugin-react-hooks";
|
||||||
|
import prettier from "eslint-plugin-prettier";
|
||||||
|
|
||||||
|
export default tseslint.config(
|
||||||
|
{
|
||||||
|
ignores: ["node_modules", "dist"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
settings: {
|
||||||
|
react: {
|
||||||
|
version: "detect"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
eslint.configs.recommended,
|
||||||
|
tseslint.configs.recommended,
|
||||||
|
react.configs.flat.recommended,
|
||||||
|
{
|
||||||
|
files: ["**/*.{ts,tsx}"],
|
||||||
|
languageOptions: {
|
||||||
|
ecmaVersion: 2020,
|
||||||
|
globals: globals.browser
|
||||||
|
},
|
||||||
|
plugins: {
|
||||||
|
react,
|
||||||
|
"react-hooks": reactHooks,
|
||||||
|
prettier
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
...reactHooks.configs.recommended.rules,
|
||||||
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
|
"react-hooks/rules-of-hooks": "error",
|
||||||
|
"react-hooks/exhaustive-deps": "warn",
|
||||||
|
"@typescript-eslint/no-unused-expressions": "off",
|
||||||
|
"@typescript-eslint/no-require-imports": "off"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
|
@ -13,5 +13,6 @@
|
||||||
"lines": 50,
|
"lines": 50,
|
||||||
"statements": 50
|
"statements": 50
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"testPathIgnorePatterns": ["/node_modules/"]
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
40
package.json
40
package.json
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@flare/lumrop",
|
"name": "@flare/lumrop",
|
||||||
"version": "1.2.0",
|
"version": "1.3.0",
|
||||||
"description": "lumrop is a versatile npm package that provides a collection of React components, hooks, and utilities designed to simplify and enhance development within the React ecosystem.",
|
"description": "lumrop is a versatile npm package that provides a collection of React components, hooks, and utilities designed to simplify and enhance development within the React ecosystem.",
|
||||||
"main": "./dist/cjs/index.js",
|
"main": "./dist/cjs/index.js",
|
||||||
"module": "./dist/esm/index.js",
|
"module": "./dist/esm/index.js",
|
||||||
|
@ -49,28 +49,26 @@
|
||||||
"README.md"
|
"README.md"
|
||||||
],
|
],
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0"
|
||||||
"react-dom": "^18.2.0"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@testing-library/react": "^12.1.5",
|
"@eslint/js": "^9.24.0",
|
||||||
"@testing-library/react-hooks": "^7.0.2",
|
"@testing-library/react": "^16.2.0",
|
||||||
"@types/jest": "^29.4.0",
|
"@types/jest": "^29.5.14",
|
||||||
"@types/react": "^18.0.27",
|
"@types/react": "^19.1.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.51.0",
|
"eslint": "^9.24.0",
|
||||||
"@typescript-eslint/parser": "^5.51.0",
|
"eslint-plugin-prettier": "^5.2.5",
|
||||||
"eslint": "^8.34.0",
|
"eslint-plugin-react": "^7.37.5",
|
||||||
"eslint-config-prettier": "^8.6.0",
|
"eslint-plugin-react-hooks": "^5.2.0",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"jest": "^29.7.0",
|
||||||
"eslint-plugin-react": "^7.32.2",
|
"jest-canvas-mock": "^2.5.2",
|
||||||
"eslint-plugin-react-hooks": "^4.6.0",
|
"jest-environment-jsdom": "^29.7.0",
|
||||||
"jest": "^29.4.2",
|
"prettier": "^3.5.3",
|
||||||
"jest-environment-jsdom": "^29.4.2",
|
"react": "^19.1.0",
|
||||||
"prettier": "^2.8.4",
|
"react-dom": "19.1.0",
|
||||||
"react": "^16.14.0",
|
"ts-jest": "^29.3.1",
|
||||||
"react-dom": "16.14.0",
|
"typescript": "^5.8.3",
|
||||||
"ts-jest": "^29.0.5",
|
"typescript-eslint": "^8.29.0"
|
||||||
"typescript": "^4.9.5"
|
|
||||||
},
|
},
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"registry": "https://lab.code-rove.com/public-node-registry"
|
"registry": "https://lab.code-rove.com/public-node-registry"
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// Copyright (c) 2022 Tudor Stanciu
|
||||||
|
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
|
|
||||||
const useLink = (href: string, rel: string) => {
|
const useLink = (href: string, rel: string) => {
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// Copyright (c) 2022 Tudor Stanciu
|
||||||
|
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
|
|
||||||
const useTitle = (title: string): void => {
|
const useTitle = (title: string): void => {
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// Copyright (c) 2022 Tudor Stanciu
|
||||||
|
|
||||||
import { useState, useEffect, useMemo } from "react";
|
import { useState, useEffect, useMemo } from "react";
|
||||||
|
|
||||||
const screenSizeLimits = {
|
const screenSizeLimits = {
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// Copyright (c) 2022 Tudor Stanciu
|
||||||
|
|
||||||
import useWindowSize from "./hooks/useWindowSize";
|
import useWindowSize from "./hooks/useWindowSize";
|
||||||
import useLink from "./hooks/useLink";
|
import useLink from "./hooks/useLink";
|
||||||
import useTitle from "./hooks/useTitle";
|
import useTitle from "./hooks/useTitle";
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
import { renderHook, act } from "@testing-library/react-hooks";
|
// Copyright (c) 2022 Tudor Stanciu
|
||||||
|
|
||||||
|
import { renderHook, act } from "@testing-library/react";
|
||||||
import { useLink } from "../src";
|
import { useLink } from "../src";
|
||||||
|
|
||||||
describe("useLink", () => {
|
describe("useLink", () => {
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
import { renderHook, act } from "@testing-library/react-hooks";
|
// Copyright (c) 2022 Tudor Stanciu
|
||||||
|
|
||||||
|
import { renderHook, act } from "@testing-library/react";
|
||||||
import { useTitle } from "../src";
|
import { useTitle } from "../src";
|
||||||
|
|
||||||
describe("useTitle", () => {
|
describe("useTitle", () => {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { act, renderHook } from "@testing-library/react-hooks";
|
// Copyright (c) 2022 Tudor Stanciu
|
||||||
import { waitFor } from "@testing-library/dom";
|
|
||||||
|
import { act, renderHook, waitFor } from "@testing-library/react";
|
||||||
import { useWindowSize } from "../src";
|
import { useWindowSize } from "../src";
|
||||||
|
|
||||||
describe("useWindowSize", () => {
|
describe("useWindowSize", () => {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"include": ["src"],
|
"include": ["src"],
|
||||||
"exclude": ["dist", "node_modules"],
|
"exclude": ["dist", "node_modules"],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es5",
|
"target": "es6",
|
||||||
"module": "esnext",
|
"module": "esnext",
|
||||||
"lib": ["dom", "esnext"],
|
"lib": ["dom", "esnext"],
|
||||||
"importHelpers": true,
|
"importHelpers": true,
|
||||||
|
|
Loading…
Reference in New Issue