diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 9002118a..00000000 --- a/.eslintignore +++ /dev/null @@ -1,10 +0,0 @@ -.git -.npmrc -.yarnrc -build -dist -node_modules -coverage -config -styleguide -example diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index ab2a60ee..00000000 --- a/.eslintrc.json +++ /dev/null @@ -1,137 +0,0 @@ -{ - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": 2018, - "sourceType": "module", - "ecmaFeatures": { - "jsx": true - } - }, - "env": { - "browser": true, - "shared-node-browser": true, - "node": true, - "es6": true - }, - "extends": [ - "plugin:react/recommended", - "plugin:@typescript-eslint/recommended", - "plugin:prettier/recommended", - "eslint:recommended", - "prettier", - "plugin:prettier/recommended", - "plugin:react-hooks/recommended", - "plugin:import/errors", - "plugin:import/warnings" - ], - "plugins": [ - "@typescript-eslint", - "react", - "prettier", - "react-hooks", - "import", - "jest" - ], - "rules": { - "eqeqeq": "error", - "no-var": "error", - "prefer-const": "error", - "curly": ["warn", "multi-line", "consistent"], - "no-console": "off", - "import/no-unresolved": [ - "warn", - { - "commonjs": true, - "amd": true - } - ], - "import/export": "error", - "@typescript-eslint/no-duplicate-imports": ["error"], - "@typescript-eslint/explicit-module-boundary-types": "off", - "@typescript-eslint/no-unused-vars": [ - "warn", - { - "argsIgnorePattern": "^_", - "varsIgnorePattern": "^_" - } - ], - "@typescript-eslint/no-use-before-define": "off", - "@typescript-eslint/no-empty-function": "off", - "@typescript-eslint/no-empty-interface": "off", - "@typescript-eslint/no-explicit-any": "off", - "jest/consistent-test-it": [ - "error", - { - "fn": "it", - "withinDescribe": "it" - } - ], - "import/order": [ - "error", - { - "alphabetize": { - "order": "asc", - "caseInsensitive": true - }, - "groups": [ - "builtin", - "external", - "internal", - "parent", - "sibling", - "index", - "object" - ], - "newlines-between": "never", - "pathGroups": [ - { - "pattern": "react", - "group": "builtin", - "position": "before" - } - ], - "pathGroupsExcludedImportTypes": ["builtin"] - } - ], - "react/jsx-uses-react": "off", - "react/react-in-jsx-scope": "off", - "sort-imports": [ - "error", - { - "ignoreDeclarationSort": true - } - ] - }, - "settings": { - "react": { - "version": "detect" - }, - "import/extensions": [".js", ".jsx", ".ts", ".tsx"], - "import/parsers": { - "@typescript-eslint/parser": [".js", ".jsx", ".ts", ".tsx"] - } - }, - "globals": { - "__DEV__": true - }, - "overrides": [ - { - "files": ["src"], - "parserOptions": { - "project": "./tsconfig.json" - } - }, - { - "files": ["tests/**/*.tsx"], - "env": { - "jest/globals": true - } - }, - { - "files": ["./*.js"], - "rules": { - "@typescript-eslint/no-var-requires": "off" - } - } - ] -} diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 42c9d9bf..d148b2d5 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -26,7 +26,7 @@ jobs: node-version: ${{ matrix.node-version }} - name: npm install, build, and test run: | - npm install -g npm@9 + npm install -g npm@11 npm ci npm run build --if-present npm run test diff --git a/.gitignore b/.gitignore index 90c38e15..650db22d 100644 --- a/.gitignore +++ b/.gitignore @@ -152,5 +152,6 @@ node_modules psd thumb sketch +dist # End of https://www.toptal.com/developers/gitignore/api/react,node \ No newline at end of file diff --git a/.husky/pre-push b/.husky/pre-push index ba862076..2c87534d 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,4 +1,4 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" -npm run eslint && npm run build && npm test +npm run lint && npm run build && npm test diff --git a/.lintstagedrc.json b/.lintstagedrc.json index 7cbf4eec..3c97e62b 100644 --- a/.lintstagedrc.json +++ b/.lintstagedrc.json @@ -1,5 +1,4 @@ { - "package.json": "sort-package-json", - "*": "prettier --write --ignore-unknown", - "*.{ts,tsx}": ["eslint --fix", "prettier --write"] + "*.{ts,tsx,js,jsx}": ["eslint --fix", "prettier --write"], + "*.{json,md,css}": "prettier --write" } diff --git a/README.md b/README.md index ca67a52e..27e8d39e 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,27 @@ You can see a live demo [here](https://githubbox.com/chintan9/plyr-react/tree/ma > Make sure to select the version for the plyr-react in the dependencies. -## Installation +### Plyr-React: The Complete Guide to a Customizable React Media Player + +**Plyr-React** is a responsive, accessible, and highly customizable media player component for React. It wraps the popular [Plyr](https://github.com/sampotts/plyr) media player, providing a simple and powerful way to integrate video, audio, YouTube, and Vimeo content into your React applications. + +The library is designed for modern development, featuring a tree-shakeable and side-effect-free build, ensuring optimal performance. It offers both a simple component for quick setup and an advanced hook for complex, custom integrations. + +#### Key Features + +- **Broad Media Support:** Natively supports HTML5 `