diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..86dc3f3 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +/dist +/node_modules +/.github +/examples +/.git + esbuild.js \ No newline at end of file diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..1266d5c --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "extends": ["plugin:@typescript-eslint/recommended", "airbnb-base", "prettier"], + "parser": "@typescript-eslint/parser", + "plugins": ["prettier", "@typescript-eslint"], + "rules": { + "prettier/prettier": "error", + "no-unused-vars": ["error", { "vars": "all", "args": "none" }], + "no-console": "off", + "import/order": "error", + "import/no-unresolved": "off", + "import/named": 0, + "import/extensions": "off", + "import/prefer-default-export": "off", + "no-plusplus": "off", + "no-shadow": "off", + "@typescript-eslint/ban-ts-comment": "off" + } +} diff --git a/.github/workflows/js.yml b/.github/workflows/js.yml index 861142d..d6d38d4 100644 --- a/.github/workflows/js.yml +++ b/.github/workflows/js.yml @@ -23,5 +23,8 @@ jobs: - name: TSC run: yarn tsc + - name: yarn lint + run: yarn lint + - name: Build run: yarn build diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 6cacc68..3c4beba 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -1,25 +1,25 @@ on: - push: - branches: - - main + push: + branches: + - main jobs: - publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: actions/setup-node@v3 - with: - cache: "yarn" - node-version: 18 + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-node@v3 + with: + cache: 'yarn' + node-version: 18 - - name: Install node modules - run: yarn + - name: Install node modules + run: yarn - - name: Build - run: yarn build + - name: Build + run: yarn build - - uses: JS-DevTools/npm-publish@v3 - with: - token: ${{ secrets.NPM_TOKEN }} + - uses: JS-DevTools/npm-publish@v3 + with: + token: ${{ secrets.NPM_TOKEN }} diff --git a/.npmignore b/.npmignore index 88b83da..7518b26 100644 --- a/.npmignore +++ b/.npmignore @@ -8,4 +8,5 @@ /.github /src .nvmrc -./scripts \ No newline at end of file +./scripts +esbuild.js diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..4f6dbe1 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,6 @@ + +dist/ +node_modules/ +examples/ +.git/ +.github/ diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..8dac37c --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,6 @@ +{ + "printWidth": 100, + "useTabs": false, + "tabWidth": 4, + "singleQuote": true +} diff --git a/README.md b/README.md index 2bb2b87..524ae14 100644 --- a/README.md +++ b/README.md @@ -1,44 +1,51 @@ - -# [Intosoft QR Code](https://qrcode.intosoft.com/) · [](https://github.com/Intosoft/qrcode/blob/main/LICENSE) +# [Intosoft QR Code](https://qrcode.intosoft.com/) · [](https://github.com/Intosoft/qrcode/blob/main/LICENSE) Intosoft QR Code is a fully customizable open source QR code generator tool. -- **Versatile and Customizable:** Fully color, style, content customization -- **Seamless Integration:** Integrate Intosoft QRcode seamlessly into your existing tech stack, whether you're working with React, React Native, NodeJS, Vue.js, Angular, or pure JavaScript. - + +- **Versatile and Customizable:** Fully color, style, content customization +- **Seamless Integration:** Integrate Intosoft QRcode seamlessly into your existing tech stack, whether you're working with React, React Native, NodeJS, Vue.js, Angular, or pure JavaScript. + [Start customizing](https://qrcode.intosoft.com) ## Installation + NPM + ``` npm i @intosoft/qrcode ``` + Yarn + ``` yarn add @intosoft/qrcode -``` -## Examples +``` + +## Examples React + ```jsx -import { generateSVGString } from '@intosoft/qrcode'; +import { generateSVGString } from '@intosoft/qrcode'; const svgString = generateSVGString(); -export const RenderQR = () => { - return (
); +export const RenderQR = () => { + return ; }; ``` React Native First Install [react-native-svg](https://github.com/software-mansion/react-native-svg) + ```jsx -import { SvgFromXml } from "react-native-svg"; -import { generateSVGString } from '@intosoft/qrcode'; +import { SvgFromXml } from 'react-native-svg'; +import { generateSVGString } from '@intosoft/qrcode'; const svgString = generateSVGString(); -export const RenderQR = () => { - return (