Skip to content

Commit

Permalink
feat: added useAnimationRef hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan-Zayne committed Sep 7, 2024
1 parent 83530e5 commit 1256ae4
Show file tree
Hide file tree
Showing 21 changed files with 905 additions and 348 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
Expand Down
68 changes: 46 additions & 22 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
/* eslint-disable jsdoc/check-tag-names */
/// <reference path="./eslint-typegen.d.ts" />

import eslintReact from "@eslint-react/eslint-plugin";
import { fixupPluginRules } from "@eslint/compat";
import eslintJs from "@eslint/js";
import eslintStylistic from "@stylistic/eslint-plugin";
import eslintImportX from "eslint-plugin-import-x";
import eslintJsdoc from "eslint-plugin-jsdoc";
import eslintPerfectionist from "eslint-plugin-perfectionist";
import eslintReactHooks from "eslint-plugin-react-hooks";
import eslintUnicorn from "eslint-plugin-unicorn";
import typegen from "eslint-typegen";
import globals from "globals";
Expand All @@ -28,12 +30,14 @@ const augumentedTypegen = (...args) => typegen(...args);
const eslintConfigArray = augumentedTypegen([
// == Global Options
{
ignores: ["dist/**", "build/**", "eslint-typegen.d.ts", "config/**"],
ignores: ["dist/**", "build/**", "eslint-typegen.d.ts", "config/**", "eslint.config.js"],
name: "zayne/defaults/ignores",
},

{
languageOptions: {
ecmaVersion: "latest",

globals: {
...globals.browser,
...globals.node,
Expand All @@ -44,6 +48,8 @@ const eslintConfigArray = augumentedTypegen([
project: "config/tsconfig.eslint.json",
tsconfigRootDir: import.meta.dirname,
},

sourceType: "module",
},

name: "zayne/defaults/languageOptions",
Expand Down Expand Up @@ -384,17 +390,49 @@ const eslintConfigArray = augumentedTypegen([
},
},

// == Import rules (Important)
// == React Rules
{
languageOptions: {
parserOptions: eslintImportX.configs.react.parserOptions,
name: "zayne/@eslint-react",
plugins: {
...eslintReact.configs["recommended-type-checked"].plugins,
"react-hooks": fixupPluginRules(eslintReactHooks),
},

rules: {
...eslintReact.configs["recommended-type-checked"].rules,
"@eslint-react/avoid-shorthand-boolean": "error",
"@eslint-react/function-component-definition": "off",
"@eslint-react/hooks-extra/ensure-custom-hooks-using-other-hooks": "error",
"@eslint-react/hooks-extra/prefer-use-state-lazy-initialization": "error",
"@eslint-react/naming-convention/component-name": "warn",
"@eslint-react/naming-convention/use-state": "warn",
"@eslint-react/no-array-index-key": "error",
"@eslint-react/no-children-count": "off",
"@eslint-react/no-children-only": "off",
"@eslint-react/no-children-prop": "error",
"@eslint-react/no-children-to-array": "off",
"@eslint-react/no-clone-element": "off",
"@eslint-react/no-missing-component-display-name": "error",
"@eslint-react/prefer-destructuring-assignment": "error",
"@eslint-react/prefer-read-only-props": "off",
"@eslint-react/prefer-shorthand-fragment": "error",

// Hook rules
"react-hooks/exhaustive-deps": "warn",
"react-hooks/rules-of-hooks": "error",
},
},

// == Import rules (Important)
{
...eslintImportX.flatConfigs.recommended,
...eslintImportX.flatConfigs.typescript,
name: "import-x/recommended",
},
{
name: "zayne/import-x",
plugins: { "import-x": eslintImportX },

rules: {
...eslintImportX.configs.recommended.rules,
...eslintImportX.configs.typescript.rules,
"import-x/export": "error",
"import-x/extensions": [
"error",
Expand All @@ -418,10 +456,6 @@ const eslintConfigArray = augumentedTypegen([
"import-x/no-useless-path-segments": ["error", { commonjs: true }],
"import-x/prefer-default-export": "off",
},
settings: {
...eslintImportX.configs.typescript.settings,
...eslintImportX.configs.react.settings,
},
},

// == Jsdoc rules (Nice to have)
Expand Down Expand Up @@ -459,16 +493,6 @@ const eslintConfigArray = augumentedTypegen([
"unicorn/prevent-abbreviations": "off",
},
},

// // == Sonarjs Rules (Optional)
// { ...eslintSonarJs.configs.recommended, name: "sonarjs/recommended" },
// {
// name: "zayne/sonarjs",
// rules: {
// "sonarjs/no-duplicate-string": "off",
// "sonarjs/prefer-immediate-return": "off",
// },
// },
]);

export default eslintConfigArray;
26 changes: 16 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,39 +26,45 @@
"test:attw": "attw --pack . --ignore-rules=cjs-resolves-to-esm",
"test:release": "pkg-pr-new publish",
"build": "tsup",
"build:dev": "tsup --watch",
"build:dev": "cross-env NODE_ENV=development tsup",
"build:test": "concurrently --prefix-colors \"yellow.bold,#7da4f8.bold,magenta\" --names PUBLINT,TSUP,ATTW 'pnpm:test:publint' 'pnpm:build:dev'",
"version-package": "changeset version",
"release": "changeset publish",
"inspect:eslint-config": "pnpx @eslint/config-inspector@latest"
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.15.4",
"@changesets/cli": "^2.27.7",
"@total-typescript/ts-reset": "^0.5.1",
"@changesets/cli": "^2.27.8",
"@eslint-react/eslint-plugin": "^1.13.0",
"@eslint/compat": "^1.1.1",
"@eslint/js": "^9.9.1",
"@size-limit/esbuild-why": "^11.1.4",
"@size-limit/preset-small-lib": "^11.1.4",
"@stylistic/eslint-plugin": "^2.7.2",
"@total-typescript/ts-reset": "^0.6.1",
"@types/node": "^22.5.4",
"@zayne-labs/tsconfig": "^0.1.1",
"concurrently": "^8.2.2",
"cross-env": "^7.0.3",
"eslint": "^9.9.1",
"eslint-plugin-import-x": "^4.1.1",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-import-x": "^4.2.1",
"eslint-plugin-jsdoc": "^50.2.2",
"eslint-plugin-perfectionist": "^3.3.0",
"eslint-plugin-perfectionist": "^3.4.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-unicorn": "^55.0.0",
"eslint-typegen": "^0.3.1",
"globals": "^15.9.0",
"husky": "^9.1.5",
"lint-staged": "^15.2.10",
"pkg-pr-new": "^0.0.23",
"pkg-pr-new": "^0.0.24",
"prettier": "^3.3.3",
"publint": "^0.2.10",
"size-limit": "^11.1.4",
"terser": "^5.31.6",
"tsup": "^8.2.4",
"typescript": "5.5.4",
"typescript-eslint": "^8.3.0"
"typescript-eslint": "^8.4.0"
},
"peerDependencies": {
"@types/react": ">=18.0.0",
Expand Down Expand Up @@ -91,15 +97,15 @@
],
"size-limit": [
{
"path": "./src/core/index.ts",
"path": "./dist/min/core/index.js",
"limit": "3 kb"
},
{
"path": "./src/react/index.ts",
"path": "./dist/min/react/index.js",
"limit": "5 kb"
},
{
"path": "./src/type-helpers/index.ts",
"path": "./dist/min/type-helpers/index.js",
"limit": "500 b"
}
],
Expand Down
Loading

0 comments on commit 1256ae4

Please sign in to comment.