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
|
||||
|
||||
Copyright (c) 2023 Tudor Stanciu
|
||||
Copyright (c) 2022 Tudor Stanciu
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
|
|
@ -49,6 +49,11 @@ npm test
|
|||
|
||||
## Changelog
|
||||
|
||||
### 1.3.0
|
||||
|
||||
- Upgraded dependencies to their latest versions.
|
||||
- Refactored codebase to use ES6 modules and syntax.
|
||||
|
||||
### v1.2.0
|
||||
|
||||
- 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,
|
||||
"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",
|
||||
"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.",
|
||||
"main": "./dist/cjs/index.js",
|
||||
"module": "./dist/esm/index.js",
|
||||
|
@ -49,28 +49,26 @@
|
|||
"README.md"
|
||||
],
|
||||
"peerDependencies": {
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0"
|
||||
"react": "^18.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@testing-library/react": "^12.1.5",
|
||||
"@testing-library/react-hooks": "^7.0.2",
|
||||
"@types/jest": "^29.4.0",
|
||||
"@types/react": "^18.0.27",
|
||||
"@typescript-eslint/eslint-plugin": "^5.51.0",
|
||||
"@typescript-eslint/parser": "^5.51.0",
|
||||
"eslint": "^8.34.0",
|
||||
"eslint-config-prettier": "^8.6.0",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"eslint-plugin-react": "^7.32.2",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"jest": "^29.4.2",
|
||||
"jest-environment-jsdom": "^29.4.2",
|
||||
"prettier": "^2.8.4",
|
||||
"react": "^16.14.0",
|
||||
"react-dom": "16.14.0",
|
||||
"ts-jest": "^29.0.5",
|
||||
"typescript": "^4.9.5"
|
||||
"@eslint/js": "^9.24.0",
|
||||
"@testing-library/react": "^16.2.0",
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/react": "^19.1.0",
|
||||
"eslint": "^9.24.0",
|
||||
"eslint-plugin-prettier": "^5.2.5",
|
||||
"eslint-plugin-react": "^7.37.5",
|
||||
"eslint-plugin-react-hooks": "^5.2.0",
|
||||
"jest": "^29.7.0",
|
||||
"jest-canvas-mock": "^2.5.2",
|
||||
"jest-environment-jsdom": "^29.7.0",
|
||||
"prettier": "^3.5.3",
|
||||
"react": "^19.1.0",
|
||||
"react-dom": "19.1.0",
|
||||
"ts-jest": "^29.3.1",
|
||||
"typescript": "^5.8.3",
|
||||
"typescript-eslint": "^8.29.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"registry": "https://lab.code-rove.com/public-node-registry"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Copyright (c) 2022 Tudor Stanciu
|
||||
|
||||
import { useEffect } from "react";
|
||||
|
||||
const useLink = (href: string, rel: string) => {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Copyright (c) 2022 Tudor Stanciu
|
||||
|
||||
import { useEffect } from "react";
|
||||
|
||||
const useTitle = (title: string): void => {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Copyright (c) 2022 Tudor Stanciu
|
||||
|
||||
import { useState, useEffect, useMemo } from "react";
|
||||
|
||||
const screenSizeLimits = {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Copyright (c) 2022 Tudor Stanciu
|
||||
|
||||
import useWindowSize from "./hooks/useWindowSize";
|
||||
import useLink from "./hooks/useLink";
|
||||
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";
|
||||
|
||||
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";
|
||||
|
||||
describe("useTitle", () => {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { act, renderHook } from "@testing-library/react-hooks";
|
||||
import { waitFor } from "@testing-library/dom";
|
||||
// Copyright (c) 2022 Tudor Stanciu
|
||||
|
||||
import { act, renderHook, waitFor } from "@testing-library/react";
|
||||
import { useWindowSize } from "../src";
|
||||
|
||||
describe("useWindowSize", () => {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"include": ["src"],
|
||||
"exclude": ["dist", "node_modules"],
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"target": "es6",
|
||||
"module": "esnext",
|
||||
"lib": ["dom", "esnext"],
|
||||
"importHelpers": true,
|
||||
|
|
Loading…
Reference in New Issue