├── .changeset └── config.json ├── .eslintignore ├── .eslintrc.cjs ├── .github └── workflows │ ├── changesets-dependencies.yaml │ ├── ci-node-matrix.yml │ ├── ci.yml │ ├── lint.yml │ ├── pr.yml │ ├── release-snapshot.yml │ ├── release-stable.yml │ ├── release.yml │ └── validate-mdx-links.yaml ├── .gitignore ├── .node-version ├── .prettierignore ├── .vscode └── settings.json ├── LICENSE ├── README.md ├── cspell.config.cjs ├── eslint-remote-tester.config.ts ├── package.json ├── packages ├── eslint-config │ ├── CHANGELOG.md │ ├── README.md │ ├── package.json │ └── src │ │ ├── base.js │ │ ├── constants.js │ │ ├── cspell.config.js │ │ ├── index.js │ │ ├── json.js │ │ ├── mdx.js │ │ ├── react-base.js │ │ ├── react.js │ │ └── yml.js ├── prettier-config │ ├── CHANGELOG.md │ ├── README.md │ ├── index.js │ └── package.json └── tailwind-config │ ├── CHANGELOG.md │ ├── README.md │ ├── package.json │ ├── src │ ├── hive-colors.ts │ ├── postcss.config.ts │ └── tailwind.config.ts │ ├── tsconfig.json │ └── tsup.config.ts ├── patches └── eslint-remote-tester@3.0.1.patch ├── pnpm-lock.yaml ├── pnpm-workspace.yaml ├── prettier.config.js ├── renovate.json ├── setup └── action.yml ├── tsconfig.json └── website-cf └── action.yml /.changeset/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://unpkg.com/@changesets/config@2.1.0/schema.json", 3 | "changelog": "@changesets/cli/changelog", 4 | "commit": false, 5 | "linked": [], 6 | "access": "public", 7 | "baseBranch": "main", 8 | "updateInternalDependencies": "patch", 9 | "ignore": [], 10 | "snapshot": { 11 | "useCalculatedVersion": true, 12 | "prereleaseTemplate": "{tag}-{datetime}-{commit}" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | .eslintrc.cjs 2 | .prettierrc.cjs 3 | **/*.js 4 | **/*.md 5 | -------------------------------------------------------------------------------- /.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: [ 3 | '@theguild', 4 | '@theguild/eslint-config/react', 5 | '@theguild/eslint-config/json', 6 | '@theguild/eslint-config/yml', 7 | '@theguild/eslint-config/mdx', 8 | ], 9 | env: { 10 | node: true, 11 | }, 12 | overrides: [ 13 | { 14 | files: 'packages/eslint-config/**', 15 | rules: { 16 | '@typescript-eslint/no-require-imports': 'off', 17 | }, 18 | }, 19 | { 20 | files: 'packages/prettier-config/README.md/*.js', 21 | rules: { 22 | 'unicorn/prefer-export-from': 'off', 23 | 'import/no-default-export': 'off', 24 | }, 25 | }, 26 | ], 27 | ignorePatterns: ['eslint-remote-tester-results'], 28 | }; 29 | -------------------------------------------------------------------------------- /.github/workflows/changesets-dependencies.yaml: -------------------------------------------------------------------------------- 1 | # Note: this is a shared pipeline used by other repositories. 2 | # Docs: https://docs.github.com/en/actions/using-workflows/reusing-workflows 3 | 4 | on: 5 | workflow_call: 6 | inputs: 7 | installDependencies: 8 | type: boolean 9 | default: false 10 | preCommit: 11 | type: string 12 | required: false 13 | packageManager: 14 | type: string 15 | required: false 16 | default: yarn 17 | packageManagerVersion: 18 | type: string 19 | description: Package manager version 20 | required: false 21 | default: '' 22 | nodeVersion: 23 | required: false 24 | type: string 25 | default: '22' 26 | secrets: 27 | githubToken: 28 | required: true 29 | 30 | jobs: 31 | changeset: 32 | runs-on: ubuntu-24.04 33 | if: github.event.pull_request.head.repo.full_name == github.repository 34 | steps: 35 | - name: Checkout 36 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 37 | with: 38 | fetch-depth: 0 39 | token: ${{ secrets.githubToken }} 40 | 41 | - uses: the-guild-org/shared-config/setup@main 42 | name: setup env and install dependencies 43 | if: ${{ inputs.installDependencies }} 44 | with: 45 | nodeVersion: ${{ inputs.nodeVersion }} 46 | packageManager: ${{ inputs.packageManager }} 47 | packageManagerVersion: ${{ inputs.packageManagerVersion }} 48 | 49 | - name: Create/Update Changesets 50 | uses: the-guild-org/changesets-dependencies-action@main 51 | with: 52 | preCommit: ${{ inputs.preCommit }} 53 | env: 54 | GITHUB_TOKEN: ${{ secrets.githubToken }} 55 | -------------------------------------------------------------------------------- /.github/workflows/ci-node-matrix.yml: -------------------------------------------------------------------------------- 1 | # Note: this is a shared pipeline used by other repositories. 2 | # Docs: https://docs.github.com/en/actions/using-workflows/reusing-workflows 3 | 4 | on: 5 | workflow_call: 6 | inputs: 7 | script: 8 | required: true 9 | type: string 10 | nodeVersions: 11 | required: true 12 | type: string 13 | default: '[22]' 14 | packageManager: 15 | type: string 16 | required: false 17 | default: yarn 18 | packageManagerVersion: 19 | type: string 20 | description: Package manager version 21 | required: false 22 | default: '' 23 | 24 | jobs: 25 | ci_setup: 26 | runs-on: ubuntu-24.04 27 | outputs: 28 | matrix: ${{ steps.setVariables.outputs.matrix }} 29 | steps: 30 | - id: setVariables 31 | run: echo "matrix=$input" >> $GITHUB_OUTPUT 32 | env: 33 | input: ${{ inputs.nodeVersions }} 34 | 35 | ci: 36 | needs: ci_setup 37 | runs-on: ubuntu-24.04 38 | strategy: 39 | matrix: 40 | nodeVersion: ${{fromJson(needs.ci_setup.outputs.matrix)}} 41 | fail-fast: false 42 | name: nodejs v${{ matrix.nodeVersion }} 43 | steps: 44 | - name: checkout 45 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 46 | 47 | - uses: the-guild-org/shared-config/setup@main 48 | name: setup env 49 | with: 50 | nodeVersion: ${{matrix.nodeVersion }} 51 | packageManager: ${{inputs.packageManager}} 52 | packageManagerVersion: ${{inputs.packageManagerVersion}} 53 | 54 | - name: ${{ inputs.script }} 55 | run: ${{ inputs.script }} 56 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | # Note: this is a shared pipeline used by other repositories. 2 | # Docs: https://docs.github.com/en/actions/using-workflows/reusing-workflows 3 | 4 | on: 5 | workflow_call: 6 | inputs: 7 | nodeVersion: 8 | required: false 9 | type: string 10 | default: '22' 11 | script: 12 | required: true 13 | type: string 14 | name: 15 | required: false 16 | type: string 17 | packageManager: 18 | type: string 19 | required: false 20 | default: yarn 21 | packageManagerVersion: 22 | type: string 23 | description: Package manager version 24 | required: false 25 | default: '' 26 | jobs: 27 | ci: 28 | runs-on: ubuntu-24.04 29 | name: ${{ inputs.name || 'script' }} 30 | steps: 31 | - name: checkout 32 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 33 | 34 | - uses: the-guild-org/shared-config/setup@main 35 | name: setup env 36 | with: 37 | nodeVersion: ${{inputs.nodeVersion}} 38 | packageManager: ${{inputs.packageManager}} 39 | packageManagerVersion: ${{inputs.packageManagerVersion}} 40 | 41 | - name: ${{ inputs.script }} 42 | run: ${{ inputs.script }} 43 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | # Note: this is a shared pipeline used by other repositories. 2 | # Docs: https://docs.github.com/en/actions/using-workflows/reusing-workflows 3 | 4 | on: 5 | workflow_call: 6 | inputs: 7 | nodeVersion: 8 | required: false 9 | type: string 10 | default: '22' 11 | packageManager: 12 | type: string 13 | required: false 14 | default: yarn 15 | packageManagerVersion: 16 | type: string 17 | description: Package manager version 18 | required: false 19 | default: '' 20 | script: 21 | required: false 22 | type: string 23 | secrets: 24 | githubToken: 25 | required: false 26 | 27 | jobs: 28 | eslint: 29 | runs-on: ubuntu-24.04 30 | steps: 31 | - name: checkout 32 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 33 | 34 | - uses: the-guild-org/shared-config/setup@main 35 | name: setup env 36 | with: 37 | nodeVersion: ${{inputs.nodeVersion}} 38 | packageManager: ${{inputs.packageManager}} 39 | packageManagerVersion: ${{inputs.packageManagerVersion}} 40 | 41 | - name: lint 42 | run: ${{ inputs.script || 'yarn eslint --output-file eslint_report.json --format json .' }} 43 | continue-on-error: ${{ github.event_name == 'pull_request' }} 44 | -------------------------------------------------------------------------------- /.github/workflows/pr.yml: -------------------------------------------------------------------------------- 1 | # Note: this pipelines is for the `shared-config` library 2 | 3 | name: pr 4 | on: 5 | pull_request: 6 | branches: 7 | - main 8 | 9 | jobs: 10 | dependencies: 11 | uses: ./.github/workflows/changesets-dependencies.yaml 12 | secrets: 13 | githubToken: ${{ secrets.GITHUB_TOKEN }} 14 | 15 | alpha: 16 | uses: ./.github/workflows/release-snapshot.yml 17 | if: ${{ github.event.pull_request.title != 'Upcoming Release Changes' }} 18 | with: 19 | npmTag: alpha 20 | buildScript: build 21 | nodeVersion: 22 22 | packageManager: pnpm 23 | secrets: 24 | githubToken: ${{ secrets.GITHUB_TOKEN }} 25 | npmToken: ${{ secrets.NPM_TOKEN }} 26 | 27 | rc: 28 | uses: ./.github/workflows/release-snapshot.yml 29 | if: ${{ github.event.pull_request.title == 'Upcoming Release Changes' }} 30 | with: 31 | npmTag: rc 32 | buildScript: build 33 | nodeVersion: 22 34 | packageManager: pnpm 35 | restoreDeletedChangesets: true 36 | secrets: 37 | githubToken: ${{ secrets.GITHUB_TOKEN }} 38 | npmToken: ${{ secrets.NPM_TOKEN }} 39 | -------------------------------------------------------------------------------- /.github/workflows/release-snapshot.yml: -------------------------------------------------------------------------------- 1 | # Note: this is a shared pipeline used by other repositories. 2 | # Docs: https://docs.github.com/en/actions/using-workflows/reusing-workflows 3 | 4 | on: 5 | workflow_call: 6 | inputs: 7 | packageManager: 8 | type: string 9 | required: false 10 | default: yarn 11 | packageManagerVersion: 12 | description: Package manager version 13 | type: string 14 | required: false 15 | default: '' 16 | nodeVersion: 17 | required: false 18 | type: string 19 | default: '22' 20 | buildScript: 21 | required: false 22 | type: string 23 | default: build 24 | npmTag: 25 | required: false 26 | type: string 27 | default: npmTag 28 | exitPre: 29 | required: false 30 | type: boolean 31 | default: false 32 | restoreDeletedChangesets: 33 | required: false 34 | type: boolean 35 | default: false 36 | secrets: 37 | githubToken: 38 | required: true 39 | npmToken: 40 | required: true 41 | outputs: 42 | published: 43 | description: A boolean value to indicate whether a publishing is happened or not 44 | value: ${{ jobs.snapshot.outputs.published }} 45 | publishedPackages: 46 | description: 47 | 'A JSON array to present the published packages. The format is [{"name": "@xx/xx", 48 | "version": "1.2.0"}, {"name": "@xx/xy", "version": "0.8.9"}]' 49 | value: ${{ jobs.snapshot.outputs.publishedPackages }} 50 | 51 | jobs: 52 | snapshot: 53 | runs-on: ubuntu-24.04 54 | if: github.event.pull_request.head.repo.full_name == github.repository 55 | outputs: 56 | published: ${{ steps.changesets.outputs.published }} 57 | publishedPackages: ${{ steps.changesets.outputs.publishedPackages }} 58 | steps: 59 | - name: checkout 60 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 61 | with: 62 | fetch-depth: 0 63 | ref: ${{ github.event.pull_request.head.sha }} 64 | 65 | - uses: the-guild-org/shared-config/setup@main 66 | name: setup env 67 | with: 68 | nodeVersion: ${{inputs.nodeVersion}} 69 | packageManager: ${{inputs.packageManager}} 70 | packageManagerVersion: ${{inputs.packageManagerVersion}} 71 | 72 | - if: inputs.exitPre 73 | name: Exit Prerelease Mode 74 | run: ${{inputs.packageManager}} run changeset pre exit 75 | 76 | - if: inputs.restoreDeletedChangesets 77 | name: restore deleted changesets 78 | run: git checkout HEAD~1 -- . 79 | 80 | - name: ${{ inputs.npmTag }} release 81 | id: changesets 82 | uses: the-guild-org/changesets-snapshot-action@12ae5b6781ea75c36ece2f2e3446cee6dc093e99 # v0.0.3 83 | with: 84 | tag: ${{ inputs.npmTag }} 85 | prepareScript: '${{inputs.packageManager}} run ${{ inputs.buildScript }}' 86 | env: 87 | NPM_TOKEN: ${{ secrets.npmToken }} 88 | GITHUB_TOKEN: ${{ secrets.githubToken }} 89 | -------------------------------------------------------------------------------- /.github/workflows/release-stable.yml: -------------------------------------------------------------------------------- 1 | # Note: this is a shared pipeline used by other repositories. 2 | # Docs: https://docs.github.com/en/actions/using-workflows/reusing-workflows 3 | 4 | on: 5 | workflow_call: 6 | inputs: 7 | packageManager: 8 | type: string 9 | required: false 10 | default: yarn 11 | packageManagerVersion: 12 | type: string 13 | description: Package manager version 14 | required: false 15 | default: '' 16 | nodeVersion: 17 | required: false 18 | type: string 19 | default: '22' 20 | releaseScript: 21 | required: false 22 | type: string 23 | default: release 24 | versionScript: 25 | required: false 26 | type: string 27 | default: changeset version 28 | createGithubReleases: 29 | required: false 30 | type: string 31 | default: aggregate 32 | githubReleaseName: 33 | required: false 34 | type: string 35 | releasePrName: 36 | required: false 37 | type: string 38 | default: Upcoming Release Changes 39 | secrets: 40 | githubToken: 41 | required: true 42 | npmToken: 43 | required: true 44 | outputs: 45 | published: 46 | description: A boolean value to indicate whether a publishing is happened or not 47 | value: ${{ jobs.publish.outputs.published }} 48 | publishedPackages: 49 | description: 50 | 'A JSON array to present the published packages. The format is [{"name": "@xx/xx", 51 | "version": "1.2.0"}, {"name": "@xx/xy", "version": "0.8.9"}]' 52 | value: ${{ jobs.publish.outputs.publishedPackages }} 53 | 54 | jobs: 55 | publish: 56 | runs-on: ubuntu-24.04 57 | outputs: 58 | published: ${{ steps.changesets.outputs.published }} 59 | publishedPackages: ${{ steps.changesets.outputs.publishedPackages }} 60 | steps: 61 | - name: checkout 62 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 63 | with: 64 | fetch-depth: 0 65 | token: ${{ secrets.githubToken }} 66 | 67 | - uses: the-guild-org/shared-config/setup@main 68 | name: setup env 69 | with: 70 | nodeVersion: ${{inputs.nodeVersion}} 71 | packageManager: ${{inputs.packageManager}} 72 | packageManagerVersion: ${{inputs.packageManagerVersion}} 73 | 74 | - name: set version variables 75 | id: vars 76 | shell: bash 77 | run: | 78 | echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT 79 | echo "date=$(date +"%B %d, %Y")" >> $GITHUB_OUTPUT 80 | 81 | - name: release / pull_request 82 | id: changesets 83 | uses: dotansimha/changesets-action@069996e9be15531bd598272996fa23853d61590e # v1.5.2 84 | with: 85 | publish: '${{inputs.packageManager}} ${{ inputs.releaseScript }}' 86 | version: '${{inputs.packageManager}} ${{inputs.versionScript}}' 87 | commit: 'chore(release): update monorepo packages versions' 88 | title: ${{inputs.releasePrName}} 89 | createGithubReleases: ${{ inputs.createGithubReleases }} 90 | githubReleaseName: ${{ inputs.githubReleaseName || steps.vars.outputs.date }} 91 | env: 92 | NPM_TOKEN: ${{ secrets.npmToken }} 93 | GITHUB_TOKEN: ${{ secrets.githubToken }} 94 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | # Note: this pipelines is for the `shared-config` library 2 | 3 | name: release 4 | on: 5 | push: 6 | branches: 7 | - main 8 | 9 | jobs: 10 | stable: 11 | uses: ./.github/workflows/release-stable.yml 12 | permissions: 13 | contents: write 14 | id-token: write 15 | pull-requests: write 16 | issues: write 17 | with: 18 | releaseScript: release 19 | nodeVersion: 22 20 | packageManager: pnpm 21 | secrets: 22 | githubToken: ${{ secrets.GITHUB_TOKEN }} 23 | npmToken: ${{ secrets.NPM_TOKEN }} 24 | -------------------------------------------------------------------------------- /.github/workflows/validate-mdx-links.yaml: -------------------------------------------------------------------------------- 1 | # Note: this is a shared pipeline used by other repositories. 2 | # Docs: https://docs.github.com/en/actions/using-workflows/reusing-workflows 3 | 4 | on: 5 | workflow_call: 6 | inputs: 7 | nodeVersion: 8 | required: false 9 | type: string 10 | default: '22' 11 | packageManager: 12 | type: string 13 | required: false 14 | default: yarn 15 | packageManagerVersion: 16 | type: string 17 | description: Package manager version 18 | required: false 19 | default: '' 20 | cwd: 21 | type: string 22 | description: The directory containing the MDX files 23 | files: 24 | type: string 25 | description: The glob pattern for MDX files 26 | verbose: 27 | type: boolean 28 | description: Whether to print all scanned files 29 | default: false 30 | version: 31 | type: string 32 | description: The version of the package to validate 33 | default: 'latest' 34 | 35 | jobs: 36 | validate-mdx-links: 37 | runs-on: ubuntu-24.04 38 | timeout-minutes: 5 39 | concurrency: 40 | group: ${{ github.workflow }}-${{ github.ref }} 41 | cancel-in-progress: true 42 | 43 | steps: 44 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 45 | name: checkout 46 | 47 | - uses: the-guild-org/shared-config/setup@main 48 | name: setup env 49 | with: 50 | nodeVersion: ${{inputs.nodeVersion}} 51 | packageManager: ${{inputs.packageManager}} 52 | packageManagerVersion: ${{inputs.packageManagerVersion}} 53 | 54 | - name: validate links 55 | run: | 56 | ${{inputs.packageManager}} dlx validate-mdx-links@${{inputs.version}} \ 57 | --cwd ${{inputs.cwd}} \ 58 | --files ${{inputs.files}} \ 59 | ${{inputs.verbose && '--verbose' || ''}} 60 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | # Dependency directories 3 | node_modules/ 4 | 5 | # TypeScript cache 6 | *.tsbuildinfo 7 | 8 | # Optional eslint cache 9 | .eslintcache 10 | 11 | # dotenv environment variables file 12 | .env 13 | 14 | # Next.js build output 15 | .next/ 16 | out/ 17 | 18 | # JetBrains IntelliJ’s project specific settings files 19 | .idea/ 20 | 21 | dist/ 22 | eslint-remote-tester-results/*.md 23 | -------------------------------------------------------------------------------- /.node-version: -------------------------------------------------------------------------------- 1 | 22 2 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | pnpm-lock.yaml 2 | eslint-remote-tester-results/*.md 3 | CHANGELOG.md 4 | .changeset/*.md 5 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "yaml.schemas": { 3 | "https://json.schemastore.org/github-action.json": ".github/workflows/setup.yml" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 The Guild 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Shared Config (by The Guild) 2 | 3 | This repository is a collection of configurations, tools and examples, that demonstrate how The 4 | Guild is using their libs. 5 | 6 | We use the files stored here in our other repositories, to have a single point of truth for all 7 | configurations/pipelines needed. 8 | 9 |
10 | Step 1: changesets 11 | 12 | To setup automated release flow for your package, using `changesets`: 13 | 14 | 1. Create a monorepo, either by using `yarn` (v1) or `pnpm`. 15 | 2. Install and initialize the Changesets config by following these instructions: 16 | https://github.com/changesets/changesets/blob/main/docs/intro-to-using-changesets.md (also make 17 | sure to install `@changesets/changelog-github`) 18 | 19 | Make sure to adjust you Changesets config file, based on your repo setup: 20 | 21 | ```jsonc 22 | { 23 | "$schema": "https://unpkg.com/@changesets/config@2.1.0/schema.json", 24 | "changelog": [ 25 | "@changesets/changelog-github", // this will make nice output for changesets, with "thank you..." notes, and links to the commits + references in PRs! 26 | { "repo": "guild-member/project-repo" } // Set the repo name here 27 | ], 28 | "commit": false, 29 | "linked": [], 30 | "access": "public", 31 | "baseBranch": "master", // change if needed 32 | "updateInternalDependencies": "patch", 33 | "ignore": ["website"] // change if needed 34 | } 35 | ``` 36 | 37 | 3. Configure your monorepo packages correctly, you should make sure to have the following in your 38 | `package.json`: 39 | 40 | ```json 41 | { 42 | "publishConfig": { 43 | "directory": "dist", 44 | "access": "public" 45 | } 46 | } 47 | ``` 48 | 49 | > If you are not using a bundler/build flow, make sure to change the `directory` value if needed. 50 | 51 | 4. Configure Changesets scripts for the release/PR flows. You should have a script called `release`, 52 | that basically prepares the package for publishing, and then call `changesets` CLI to do the 53 | actual publishing: 54 | 55 | ```json 56 | { 57 | "scripts": { 58 | "release": "yarn build && changeset publish" 59 | } 60 | } 61 | ``` 62 | 63 | 5. Install Changesets Bot on your repo: https://github.com/apps/changeset-bot 64 | 65 |
66 | 67 |
68 | Step 2: Repository Settings 69 | 70 | Configure GitHub Actions permissions: Go to repo Settings > Actions > General and make sure to 71 | configure the following: 72 | 73 | - `Actions permissions` should be set to `Allow all actions and reusable workflows` 74 | - `Workflow permissions` should be set to `Read and write permissions`, and make sure the 75 | `Allow GitHub Actions to create and approve pull requests` option is active. 76 | 77 |
78 | 79 |
80 | Step 3: Unified secrets 81 | 82 | You can create an NPM publishing token by using `npm token create`. 83 | 84 | After creating your token, make sure to add it as part of your GitHub Actions Secrets (under repo 85 | Settings). Name it `NPM_TOKEN`. 86 | 87 | In addition, the shared pipelines are going to use `GITHUB_TOKEN` provided by GitHub Actions 88 | runtime. You can customize it by creating a custom PAT token for the user you wish to use. 89 | 90 |
91 | 92 |
93 | Step 4: Automatic Stable Release 94 | 95 | Create a GitHub Actions that refers to the workflow defined in this repo, along with your settings: 96 | 97 | ```yaml 98 | name: release 99 | on: 100 | push: 101 | branches: 102 | - master # change to main if needed 103 | 104 | jobs: 105 | stable: 106 | uses: the-guild-org/shared-config/.github/workflows/release-stable.yml@main 107 | with: 108 | releaseScript: release # script to run as part of publish command 109 | nodeVersion: 22 # you can change if needed 110 | secrets: 111 | githubToken: ${{ secrets.GITHUB_TOKEN }} 112 | npmToken: ${{ secrets.NPM_TOKEN }} 113 | ``` 114 | 115 | > By default, we use `aggregated` release mode. 116 | 117 |
118 | 119 |
120 | Step 5: Snapshot release for Pull Requests 121 | 122 | To setup automated release flow for your package, using `changesets`, based on PR changes, use the 123 | following setup: 124 | 125 | Start by updating your changesets `config.json` to use the following: 126 | 127 | ```jsonc 128 | { 129 | // ... other stuff 130 | "snapshot": { 131 | "useCalculatedVersion": true, 132 | "prereleaseTemplate": "{tag}-{datetime}-{commit}" 133 | } 134 | } 135 | ``` 136 | 137 | > You can customize the canary release template, see: 138 | > https://github.com/changesets/changesets/blob/main/docs/config-file-options.md#prereleasetemplate-optional-string 139 | 140 | Create a GitHub workflow (you can call it `pr.yaml`): 141 | 142 | ```yaml 143 | name: pr 144 | on: 145 | pull_request: 146 | branches: 147 | - master # change if needed 148 | 149 | jobs: 150 | release: 151 | uses: the-guild-org/shared-config/.github/workflows/release-snapshot.yml@main 152 | with: 153 | npmTag: alpha 154 | buildScript: build 155 | nodeVersion: 22 156 | secrets: 157 | githubToken: ${{ secrets.GITHUB_TOKEN }} 158 | npmToken: ${{ secrets.NPM_TOKEN }} 159 | ``` 160 | 161 | > You can choose the NPM tag of the release. We prefer using `alpha` or `canary` for PR-based 162 | > releases. 163 | 164 |
165 | 166 |
167 | Step 6: Renovate 168 | 169 | 1. Install Renovate Bot on your repo: https://github.com/marketplace/renovate 170 | 2. Wait for Renovate to create the first setup PR and merge it. 171 | 3. Create `renovate.json` config file in the repo, with the following: 172 | 173 | ``` 174 | { 175 | "extends": ["github>the-guild-org/shared-config:renovate"] 176 | } 177 | ``` 178 | 179 |
180 | 181 |
182 | Step 7: Automatic changesets for dependencies updates 183 | 184 | To get automatic changesets created for Renovate PRs (and manual dependencies changes), add the 185 | following GitHub Action workflow to your repo: 186 | 187 | > Note: you can also add this to the existing `pr.yaml` if you are using the snapshot release. 188 | 189 | ```yaml 190 | name: pr 191 | on: 192 | pull_request: 193 | branches: 194 | - master # change if needed 195 | 196 | jobs: 197 | dependencies: 198 | uses: the-guild-org/shared-config/.github/workflows/changesets-dependencies.yaml@main 199 | secrets: 200 | githubToken: ${{ secrets.GITHUB_TOKEN }} 201 | ``` 202 | 203 |
204 | 205 |
206 | Step 9: ESLint/Prettier config 207 | 208 | If you wish to use the unified config for eslint or prettier, following these instructions: 209 | 210 | - eslint: https://github.com/the-guild-org/shared-config/tree/main/packages/eslint-config 211 | - prettier: https://github.com/the-guild-org/shared-config/tree/main/packages/prettier-config 212 | 213 |
214 | 215 |
216 | Step 10: ESLint pipeline 217 | 218 | If you wish to have a lint using ESLint and report the results back to GitHub, do the following: 219 | 220 | 1. Make sure your project has eslint installed and configured 221 | 2. Add `ci:lint` script with the following flags: 222 | `eslint --output-file eslint_report.json --format json` on top of your regular ESLint CLI flags. 223 | 3. Add a CI pipelines with the following: 224 | 225 | ```yml 226 | name: test 227 | on: 228 | pull_request: 229 | branches: 230 | - master 231 | push: 232 | branches: 233 | - master 234 | 235 | jobs: 236 | lint: 237 | uses: the-guild-org/shared-config/.github/workflows/lint.yml@main 238 | with: 239 | script: yarn ci:lint 240 | secrets: 241 | githubToken: ${{ secrets.GITHUB_TOKEN }} 242 | ``` 243 | 244 |
245 | 246 |
247 | Step 11: Shared pipelines 248 | 249 | To get the most out of the shared pipelines, you can use the following to run scripts as part of 250 | your CI process: 251 | 252 | ```yml 253 | name: build 254 | on: 255 | pull_request: 256 | branches: 257 | - master 258 | push: 259 | branches: 260 | - master 261 | 262 | jobs: 263 | build: 264 | uses: the-guild-org/shared-config/.github/workflows/ci.yml@main 265 | with: 266 | script: yarn build 267 | ``` 268 | 269 | If our script is more complex and requires NodeJS version matrix, you can use this: 270 | 271 | ```yml 272 | name: build 273 | on: 274 | pull_request: 275 | branches: 276 | - master 277 | push: 278 | branches: 279 | - master 280 | 281 | jobs: 282 | build: 283 | uses: the-guild-org/shared-config/.github/workflows/ci-node-matrix.yml@main 284 | with: 285 | script: yarn build 286 | nodeVersions: '[22,23]' 287 | ``` 288 | 289 | If your script requires more stuff, and you just want to avoid configuring NodeJS + Yarn + Caches, 290 | you can just use the following to get started with your pipeline: 291 | 292 | ```yml 293 | name: test 294 | on: 295 | pull_request: 296 | branches: 297 | - master 298 | push: 299 | branches: 300 | - master 301 | 302 | jobs: 303 | test: 304 | name: myScript 305 | steps: 306 | - name: Checkout 307 | uses: actions/checkout@v3 308 | 309 | - uses: the-guild-org/shared-config/setup@main 310 | name: setup env 311 | with: 312 | nodeVersion: 22 313 | ``` 314 | 315 |
316 | -------------------------------------------------------------------------------- /cspell.config.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | language: 'en', 3 | import: ['@theguild/eslint-config/cspell.config'], 4 | words: [], 5 | ignorePaths: ['./patches/*.patch', './pnpm-lock.yaml'], 6 | }; 7 | -------------------------------------------------------------------------------- /eslint-remote-tester.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/no-default-export */ 2 | import { Config } from 'eslint-remote-tester'; 3 | 4 | const JSExtensions = ['.js', '.jsx', '.cjs', '.mjs', '.cjsx', '.mjsx'] as const; 5 | 6 | const TSExtensions = ['.ts', '.tsx', '.cts', '.mts', '.ctsx', '.mtsx'] as const; 7 | 8 | enum Repo { 9 | // Ecosystem 10 | Hive = 'kamilkisiela/graphql-hive', 11 | Yoga = 'dotansimha/graphql-yoga', 12 | Envelop = 'n1ru4l/envelop', 13 | Inspector = 'kamilkisiela/graphql-inspector', 14 | CodeGenerator = 'dotansimha/graphql-code-generator', 15 | Mesh = 'urigo/graphql-mesh', 16 | Tools = 'ardatan/graphql-tools', 17 | Modules = 'urigo/graphql-modules', 18 | ESLint = 'b2o5t/graphql-eslint', 19 | Config = 'kamilkisiela/graphql-config', 20 | Scalars = 'urigo/graphql-scalars', 21 | Shield = 'dimatill/graphql-shield', 22 | Swift = 'maticzav/swift-graphql', 23 | CLI = 'urigo/graphql-cli', 24 | SOFA = 'urigo/sofa', 25 | Stencil = 'ardatan/stencil-apollo', 26 | Angular = 'kamilkisiela/apollo-angular', 27 | WhatsApp = 'urigo/whatsapp-clone-tutorial', 28 | // Another Guild's repos 29 | Components = 'the-guild-org/the-guild-components', 30 | Website = 'the-guild-org/the-guild-website', 31 | SharedConfigs = 'the-guild-org/shared-config', 32 | TimeAgo = 'n1ru4l/react-time-ago', 33 | Bob = 'kamilkisiela/bob', 34 | DataLoader = 'graphql/dataloader', 35 | LiveQuery = 'n1ru4l/graphql-live-query', 36 | GraphiQL = 'graphql/graphiql', 37 | GraphQLOrg = 'graphql/graphql.github.io', 38 | GraphQLHTTP = 'graphql/graphql-http', 39 | GraphQLWS = 'enisdenjo/graphql-ws', 40 | GraphQLSSE = 'enisdenjo/graphql-sse', 41 | // Other 42 | Nextra = 'shuding/nextra', 43 | Satori = 'vercel/satori', 44 | NextJS = 'vercel/next.js', 45 | } 46 | 47 | const overrideConfig: Config['eslintrc'] = { 48 | root: true, 49 | parser: '@typescript-eslint/parser', 50 | parserOptions: { 51 | ecmaFeatures: { 52 | jsx: true, 53 | }, 54 | }, 55 | env: { 56 | node: true, 57 | browser: true, 58 | }, 59 | overrides: [ 60 | { 61 | files: '**/tests/**', 62 | env: { 63 | jest: true, 64 | }, 65 | }, 66 | ], 67 | plugins: [ 68 | 'sonarjs', 69 | 'unicorn', 70 | 'import', 71 | 'react', 72 | '@typescript-eslint', 73 | '@shopify', 74 | 'n', 75 | 'promise', 76 | ], 77 | rules: { 78 | 'no-restricted-syntax': [ 79 | 'error', 80 | { 81 | // ❌ process.browser 82 | selector: 83 | 'ExpressionStatement[expression.object.name=process][expression.property.name=browser]', 84 | message: '`process.browser` is deprecated, use `!!globalThis.window`', 85 | }, 86 | { 87 | // ❌ let { foo: {bar} } = baz 88 | selector: 89 | 'VariableDeclarator[init.type!=AwaitExpression] > ObjectPattern[properties.length=1][properties.0.value.type=ObjectPattern]', 90 | message: 'Do not use nested destructuring.', 91 | }, 92 | { 93 | // ❌ useMemo(…, []) 94 | selector: 95 | 'CallExpression[callee.name=useMemo][arguments.1.type=ArrayExpression][arguments.1.elements.length=0]', 96 | message: 97 | "`useMemo` with an empty dependency array can't provide a stable reference, use `useRef` instead.", 98 | }, 99 | ], 100 | }, 101 | }; 102 | 103 | const config: Config = { 104 | cache: true, 105 | extensions: [...JSExtensions, ...TSExtensions], 106 | repositories: Object.values(Repo), 107 | eslintrc: overrideConfig, 108 | pathIgnorePattern: `(${[ 109 | 'dev-test/githunt/flow.flow.js', // codegen 110 | 'dev-test/test-schema/flow-types.flow.js', // codegen 111 | 'packages/load/tests/loaders/schema/test-files/error.ts', // tools 112 | 'action/index.js', // inspector 113 | '.yarn/releases/yarn-berry.cjs', // shield 114 | // swift 115 | '.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs', 116 | '.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs', 117 | '.yarn/plugins/@yarnpkg/plugin-typescript.cjs', 118 | // next.js 119 | 'packages/next/src/compiled/babel/bundle.js', 120 | 'packages/next/src/compiled/mini-css-extract-plugin/loader.js', 121 | 'packages/next/src/compiled/undici/index.js', 122 | 'packages/next/src/compiled/ws/index.js', 123 | 'test/development/basic/hmr/components/parse-error.js', 124 | // dataloader 125 | 'flow-typed/npm/jest_v24.x.x.js', 126 | 'src/__tests__/abuse.test.js', 127 | 'src/__tests__/browser.test.js', 128 | 'src/__tests__/dataloader.test.js', 129 | 'src/__tests__/oldbrowser.test.js', 130 | 'src/__tests__/unhandled.test.js', 131 | ].join('|')})`, 132 | rulesUnderTesting: () => true, 133 | }; 134 | 135 | export default config; 136 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "shared-configs", 3 | "type": "module", 4 | "description": "Guild's shared configs following our styleguide", 5 | "repository": "git@github.com:the-guild-org/shared-config.git", 6 | "author": { 7 | "name": "The Guild", 8 | "url": "https://the-guild.dev" 9 | }, 10 | "license": "MIT", 11 | "private": true, 12 | "packageManager": "pnpm@10.6.4", 13 | "scripts": { 14 | "build": "echo No build command, skipping…", 15 | "cspell": "cspell --gitignore **/*", 16 | "lint": "ESLINT_USE_FLAT_CONFIG=false eslint --cache --ignore-path .gitignore .", 17 | "lint:prettier": "prettier --ignore-path .gitignore --ignore-path .prettierignore --check .", 18 | "lint:remote": "eslint-remote-tester", 19 | "prettier": "pnpm lint:prettier --write", 20 | "release": "changeset publish" 21 | }, 22 | "devDependencies": { 23 | "@changesets/cli": "2.28.1", 24 | "@shopify/eslint-plugin": "48.0.0", 25 | "@theguild/eslint-config": "workspace:*", 26 | "@theguild/prettier-config": "workspace:*", 27 | "@types/eslint": "9.6.1", 28 | "@types/node": "22.13.10", 29 | "cspell": "8.17.5", 30 | "eslint": "9.22.0", 31 | "eslint-remote-tester": "3.0.1", 32 | "prettier": "3.5.3", 33 | "ts-node": "10.9.2", 34 | "typescript": "5.8.2" 35 | }, 36 | "pnpm": { 37 | "patchedDependencies": { 38 | "eslint-remote-tester@3.0.1": "patches/eslint-remote-tester@3.0.1.patch" 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /packages/eslint-config/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # @theguild/eslint-config 2 | 3 | ## 0.13.3 4 | 5 | ### Patch Changes 6 | 7 | - 8e90ba8: dependencies updates: 8 | - Updated dependency 9 | [`eslint-import-resolver-typescript@3.9.1` ↗︎](https://www.npmjs.com/package/eslint-import-resolver-typescript/v/3.9.1) 10 | (from `3.7.0`, in `dependencies`) 11 | 12 | ## 0.13.2 13 | 14 | ### Patch Changes 15 | 16 | - 866aef2: dependencies updates: 17 | - Updated dependency 18 | [`eslint-plugin-n@17.14.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-n/v/17.14.0) (from 19 | `17.13.2`, in `dependencies`) 20 | - f1146a6: dependencies updates: 21 | - Updated dependency 22 | [`eslint-plugin-promise@7.2.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-promise/v/7.2.0) 23 | (from `7.1.0`, in `dependencies`) 24 | - 5503b84: dependencies updates: 25 | - Updated dependency 26 | [`@typescript-eslint/eslint-plugin@8.17.0` ↗︎](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin/v/8.17.0) 27 | (from `8.15.0`, in `dependencies`) 28 | - Updated dependency 29 | [`@typescript-eslint/parser@8.17.0` ↗︎](https://www.npmjs.com/package/@typescript-eslint/parser/v/8.17.0) 30 | (from `8.15.0`, in `dependencies`) 31 | - d23da18: dependencies updates: 32 | - Updated dependency 33 | [`eslint-import-resolver-typescript@3.7.0` ↗︎](https://www.npmjs.com/package/eslint-import-resolver-typescript/v/3.7.0) 34 | (from `3.6.3`, in `dependencies`) 35 | - Updated dependency 36 | [`eslint-plugin-promise@7.2.1` ↗︎](https://www.npmjs.com/package/eslint-plugin-promise/v/7.2.1) 37 | (from `7.1.0`, in `dependencies`) 38 | - 8d4b216: dependencies updates: 39 | - Updated dependency 40 | [`eslint-plugin-yml@1.16.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-yml/v/1.16.0) (from 41 | `1.15.0`, in `dependencies`) 42 | - ef4d681: dependencies updates: 43 | - Updated dependency 44 | [`eslint-plugin-sonarjs@3.0.1` ↗︎](https://www.npmjs.com/package/eslint-plugin-sonarjs/v/3.0.1) 45 | (from `2.0.4`, in `dependencies`) 46 | - 6049e99: dependencies updates: 47 | - Updated dependency 48 | [`eslint-import-resolver-typescript@3.7.0` ↗︎](https://www.npmjs.com/package/eslint-import-resolver-typescript/v/3.7.0) 49 | (from `3.6.3`, in `dependencies`) 50 | - d0f1869: dependencies updates: 51 | - Updated dependency 52 | [`eslint-plugin-promise@7.2.1` ↗︎](https://www.npmjs.com/package/eslint-plugin-promise/v/7.2.1) 53 | (from `7.2.0`, in `dependencies`) 54 | 55 | ## 0.13.1 56 | 57 | ### Patch Changes 58 | 59 | - 3c745fe: dependencies updates: 60 | - Updated dependency 61 | [`eslint-plugin-jsonc@2.18.2` ↗︎](https://www.npmjs.com/package/eslint-plugin-jsonc/v/2.18.2) 62 | (from `2.17.0`, in `dependencies`) 63 | - 357baae: dependencies updates: 64 | - Updated dependency 65 | [`@typescript-eslint/eslint-plugin@8.15.0` ↗︎](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin/v/8.15.0) 66 | (from `8.13.0`, in `dependencies`) 67 | - Updated dependency 68 | [`@typescript-eslint/parser@8.15.0` ↗︎](https://www.npmjs.com/package/@typescript-eslint/parser/v/8.15.0) 69 | (from `8.13.0`, in `dependencies`) 70 | - cbedce1: dependencies updates: 71 | - Updated dependency 72 | [`eslint-plugin-n@17.13.2` ↗︎](https://www.npmjs.com/package/eslint-plugin-n/v/17.13.2) (from 73 | `17.13.1`, in `dependencies`) 74 | - 4eabf76: dependencies updates: 75 | - Updated dependency 76 | [`eslint-plugin-unicorn@56.0.1` ↗︎](https://www.npmjs.com/package/eslint-plugin-unicorn/v/56.0.1) 77 | (from `56.0.0`, in `dependencies`) 78 | - 254b74d: ignore default export for `_meta.global.{ts,tsx}` 79 | 80 | ## 0.13.0 81 | 82 | ### Minor Changes 83 | 84 | - a3d8e2f: ignore `import/no-default-export` for `**/app/**/{layout,page,not-found}.tsx` and 85 | `**/app/**/_meta.{ts,tsx}` 86 | 87 | ### Patch Changes 88 | 89 | - a3d8e2f: dependencies updates: 90 | - Updated dependency 91 | [`@rushstack/eslint-patch@1.10.4` ↗︎](https://www.npmjs.com/package/@rushstack/eslint-patch/v/1.10.4) 92 | (from `^1.10.4`, in `dependencies`) 93 | - Updated dependency 94 | [`@typescript-eslint/eslint-plugin@8.13.0` ↗︎](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin/v/8.13.0) 95 | (from `^7.18.0`, in `dependencies`) 96 | - Updated dependency 97 | [`@typescript-eslint/parser@8.13.0` ↗︎](https://www.npmjs.com/package/@typescript-eslint/parser/v/8.13.0) 98 | (from `^7.18.0`, in `dependencies`) 99 | - Updated dependency 100 | [`eslint-config-prettier@9.1.0` ↗︎](https://www.npmjs.com/package/eslint-config-prettier/v/9.1.0) 101 | (from `^9.1.0`, in `dependencies`) 102 | - Updated dependency 103 | [`eslint-import-resolver-typescript@3.6.3` ↗︎](https://www.npmjs.com/package/eslint-import-resolver-typescript/v/3.6.3) 104 | (from `^3.6.1`, in `dependencies`) 105 | - Updated dependency 106 | [`eslint-plugin-import@2.31.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-import/v/2.31.0) 107 | (from `^2.29.1`, in `dependencies`) 108 | - Updated dependency 109 | [`eslint-plugin-jsonc@2.16.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-jsonc/v/2.16.0) 110 | (from `^2.11.1`, in `dependencies`) 111 | - Updated dependency 112 | [`eslint-plugin-jsx-a11y@6.10.2` ↗︎](https://www.npmjs.com/package/eslint-plugin-jsx-a11y/v/6.10.2) 113 | (from `^6.8.0`, in `dependencies`) 114 | - Updated dependency 115 | [`eslint-plugin-mdx@3.1.5` ↗︎](https://www.npmjs.com/package/eslint-plugin-mdx/v/3.1.5) (from 116 | `^3.0.0`, in `dependencies`) 117 | - Updated dependency 118 | [`eslint-plugin-n@17.12.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-n/v/17.12.0) (from 119 | `^17.0.0`, in `dependencies`) 120 | - Updated dependency 121 | [`eslint-plugin-promise@7.1.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-promise/v/7.1.0) 122 | (from `^7.0.0`, in `dependencies`) 123 | - Updated dependency 124 | [`eslint-plugin-react@7.37.2` ↗︎](https://www.npmjs.com/package/eslint-plugin-react/v/7.37.2) 125 | (from `^7.33.2`, in `dependencies`) 126 | - Updated dependency 127 | [`eslint-plugin-react-hooks@5.0.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-react-hooks/v/5.0.0) 128 | (from `^4.6.0`, in `dependencies`) 129 | - Updated dependency 130 | [`eslint-plugin-sonarjs@2.0.4` ↗︎](https://www.npmjs.com/package/eslint-plugin-sonarjs/v/2.0.4) 131 | (from `^1.0.0`, in `dependencies`) 132 | - Updated dependency 133 | [`eslint-plugin-unicorn@56.0.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-unicorn/v/56.0.0) 134 | (from `^55.0.0`, in `dependencies`) 135 | - Updated dependency 136 | [`eslint-plugin-yml@1.15.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-yml/v/1.15.0) (from 137 | `^1.11.0`, in `dependencies`) 138 | - e4d672c: dependencies updates: 139 | - Updated dependency 140 | [`eslint-plugin-n@17.13.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-n/v/17.13.0) (from 141 | `17.12.0`, in `dependencies`) 142 | - 1251e53: dependencies updates: 143 | - Updated dependency 144 | [`eslint-plugin-n@17.13.1` ↗︎](https://www.npmjs.com/package/eslint-plugin-n/v/17.13.1) (from 145 | `17.13.0`, in `dependencies`) 146 | - 52bd034: dependencies updates: 147 | - Updated dependency 148 | [`eslint-plugin-jsonc@2.17.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-jsonc/v/2.17.0) 149 | (from `2.16.0`, in `dependencies`) 150 | 151 | ## 0.12.1 152 | 153 | ### Patch Changes 154 | 155 | - [#448](https://github.com/the-guild-org/shared-config/pull/448) 156 | [`7bf3875`](https://github.com/the-guild-org/shared-config/commit/7bf3875bd0e6419dc9e32487a60fe0aaf6f7d122) 157 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 158 | - Updated dependency [`eslint@^8 || ^9.0.0` ↗︎](https://www.npmjs.com/package/eslint/v/8.0.0) 159 | (from `^8`, in `peerDependencies`) 160 | 161 | ## 0.12.0 162 | 163 | ### Minor Changes 164 | 165 | - [#548](https://github.com/the-guild-org/shared-config/pull/548) 166 | [`647f2cc`](https://github.com/the-guild-org/shared-config/commit/647f2ccd878f4e7d0060275f2ed732b73771d6a7) 167 | Thanks [@dimaMachina](https://github.com/dimaMachina)! - bump `@rushstack/eslint-patch` and 168 | `@typescript-eslint/eslint-plugin` 169 | 170 | ### Patch Changes 171 | 172 | - [#548](https://github.com/the-guild-org/shared-config/pull/548) 173 | [`647f2cc`](https://github.com/the-guild-org/shared-config/commit/647f2ccd878f4e7d0060275f2ed732b73771d6a7) 174 | Thanks [@dimaMachina](https://github.com/dimaMachina)! - dependencies updates: 175 | - Updated dependency 176 | [`@rushstack/eslint-patch@^1.10.4` ↗︎](https://www.npmjs.com/package/@rushstack/eslint-patch/v/1.10.4) 177 | (from `^1.6.1`, in `dependencies`) 178 | - Updated dependency 179 | [`@typescript-eslint/eslint-plugin@^7.18.0` ↗︎](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin/v/7.18.0) 180 | (from `^7.0.0`, in `dependencies`) 181 | - Updated dependency 182 | [`@typescript-eslint/parser@^7.18.0` ↗︎](https://www.npmjs.com/package/@typescript-eslint/parser/v/7.18.0) 183 | (from `^7.0.0`, in `dependencies`) 184 | 185 | ## 0.11.11 186 | 187 | ### Patch Changes 188 | 189 | - [#533](https://github.com/the-guild-org/shared-config/pull/533) 190 | [`0027744`](https://github.com/the-guild-org/shared-config/commit/00277440cf5e8531771fb5f17527aa9f0b73cdb9) 191 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 192 | 193 | - Updated dependency 194 | [`eslint-plugin-promise@^7.0.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-promise/v/7.0.0) 195 | (from `^6.1.1`, in `dependencies`) 196 | 197 | - [#536](https://github.com/the-guild-org/shared-config/pull/536) 198 | [`59f3404`](https://github.com/the-guild-org/shared-config/commit/59f34040d185b7fc670459815ad83753a638db98) 199 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 200 | - Updated dependency 201 | [`eslint-plugin-unicorn@^55.0.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-unicorn/v/55.0.0) 202 | (from `^54.0.0`, in `dependencies`) 203 | 204 | ## 0.11.10 205 | 206 | ### Patch Changes 207 | 208 | - [#452](https://github.com/the-guild-org/shared-config/pull/452) 209 | [`c577194`](https://github.com/the-guild-org/shared-config/commit/c577194eb08551bd67f57064b204739d8f7721be) 210 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 211 | 212 | - Updated dependency 213 | [`eslint-plugin-unicorn@^53.0.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-unicorn/v/53.0.0) 214 | (from `^52.0.0`, in `dependencies`) 215 | 216 | - [#484](https://github.com/the-guild-org/shared-config/pull/484) 217 | [`d32ea18`](https://github.com/the-guild-org/shared-config/commit/d32ea18b8ad9746b5ebe7a425aa883f26304581a) 218 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 219 | 220 | - Updated dependency 221 | [`eslint-plugin-unicorn@^54.0.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-unicorn/v/54.0.0) 222 | (from `^53.0.0`, in `dependencies`) 223 | 224 | - [#492](https://github.com/the-guild-org/shared-config/pull/492) 225 | [`f310757`](https://github.com/the-guild-org/shared-config/commit/f310757dfeb41770bfc0e39e775d0097746dd1f3) 226 | Thanks [@dimaMachina](https://github.com/dimaMachina)! - forbid `close` global variable 227 | 228 | ## 0.11.9 229 | 230 | ### Patch Changes 231 | 232 | - [#438](https://github.com/the-guild-org/shared-config/pull/438) 233 | [`dc07018`](https://github.com/the-guild-org/shared-config/commit/dc07018db035a2a9ca15a1dc5e16574426471301) 234 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 235 | - Updated dependency 236 | [`eslint-plugin-sonarjs@^1.0.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-sonarjs/v/1.0.0) 237 | (from `^0.25.0`, in `dependencies`) 238 | 239 | ## 0.11.8 240 | 241 | ### Patch Changes 242 | 243 | - [#427](https://github.com/the-guild-org/shared-config/pull/427) 244 | [`47bafcd`](https://github.com/the-guild-org/shared-config/commit/47bafcdb636cdd2cd03b63f6e7905b5da3e122cf) 245 | Thanks [@dimaMachina](https://github.com/dimaMachina)! - exclude `**/*.md{,x}/*` for ts files 246 | 247 | ## 0.11.7 248 | 249 | ### Patch Changes 250 | 251 | - [#422](https://github.com/the-guild-org/shared-config/pull/422) 252 | [`2f6f4f0`](https://github.com/the-guild-org/shared-config/commit/2f6f4f059d374bbbdd6561580d1bd854cd3e65f7) 253 | Thanks [@eddeee888](https://github.com/eddeee888)! - Fix @typescript-eslint/prefer-optional-chain 254 | causing eslint to fail if .js files are not included in tsconfig 255 | 256 | ## 0.11.6 257 | 258 | ### Patch Changes 259 | 260 | - [#398](https://github.com/the-guild-org/shared-config/pull/398) 261 | [`c0cfe4c`](https://github.com/the-guild-org/shared-config/commit/c0cfe4ca77b3cc239c693250948d94d1c4aaf936) 262 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 263 | - Updated dependency 264 | [`eslint-plugin-n@^17.0.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-n/v/17.0.0) (from 265 | `^16.4.0`, in `dependencies`) 266 | 267 | ## 0.11.5 268 | 269 | ### Patch Changes 270 | 271 | - [#389](https://github.com/the-guild-org/shared-config/pull/389) 272 | [`2212760`](https://github.com/the-guild-org/shared-config/commit/221276004cbdea3ea49f703105ea848a6e3c5d46) 273 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 274 | 275 | - Updated dependency 276 | [`eslint-plugin-sonarjs@^0.25.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-sonarjs/v/0.25.0) 277 | (from `^0.24.0`, in `dependencies`) 278 | 279 | - [#395](https://github.com/the-guild-org/shared-config/pull/395) 280 | [`b1432a0`](https://github.com/the-guild-org/shared-config/commit/b1432a0226a527db5fb42679521d69da47c60d98) 281 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 282 | - Updated dependency 283 | [`eslint-plugin-unicorn@^52.0.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-unicorn/v/52.0.0) 284 | (from `^51.0.0`, in `dependencies`) 285 | 286 | ## 0.11.4 287 | 288 | ### Patch Changes 289 | 290 | - [#338](https://github.com/the-guild-org/shared-config/pull/338) 291 | [`d1b515a`](https://github.com/the-guild-org/shared-config/commit/d1b515acb0d8bcd36e59600489838bb6d33d1b69) 292 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 293 | 294 | - Updated dependency 295 | [`eslint-plugin-unicorn@^51.0.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-unicorn/v/51.0.0) 296 | (from `^50.0.0`, in `dependencies`) 297 | 298 | - [#340](https://github.com/the-guild-org/shared-config/pull/340) 299 | [`62537dd`](https://github.com/the-guild-org/shared-config/commit/62537dd30f7563803297f2b49cb70985e5fc2475) 300 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 301 | 302 | - Updated dependency 303 | [`eslint-plugin-sonarjs@^0.24.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-sonarjs/v/0.24.0) 304 | (from `^0.23.0`, in `dependencies`) 305 | 306 | - [#341](https://github.com/the-guild-org/shared-config/pull/341) 307 | [`1f9777b`](https://github.com/the-guild-org/shared-config/commit/1f9777bb20919a9bf859b7d50a2707fc5259dc6a) 308 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 309 | - Updated dependency 310 | [`@typescript-eslint/eslint-plugin@^7.0.0` ↗︎](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin/v/7.0.0) 311 | (from `^6.14.0`, in `dependencies`) 312 | - Updated dependency 313 | [`@typescript-eslint/parser@^7.0.0` ↗︎](https://www.npmjs.com/package/@typescript-eslint/parser/v/7.0.0) 314 | (from `^6.14.0`, in `dependencies`) 315 | 316 | ## 0.11.3 317 | 318 | ### Patch Changes 319 | 320 | - [#320](https://github.com/the-guild-org/shared-config/pull/320) 321 | [`43adb44`](https://github.com/the-guild-org/shared-config/commit/43adb44c8079976a761b3f4763a57d15e914a012) 322 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 323 | - Updated dependency 324 | [`eslint-plugin-unicorn@^50.0.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-unicorn/v/50.0.0) 325 | (from `^49.0.0`, in `dependencies`) 326 | 327 | ## 0.11.2 328 | 329 | ### Patch Changes 330 | 331 | - [#314](https://github.com/the-guild-org/shared-config/pull/314) 332 | [`b294956`](https://github.com/the-guild-org/shared-config/commit/b2949564f75ff128b4bee95d99ffadfaad68abe6) 333 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 334 | 335 | - Updated dependency 336 | [`eslint-plugin-mdx@^3.0.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-mdx/v/3.0.0) (from 337 | `^2.1.0`, in `dependencies`) 338 | 339 | - [#317](https://github.com/the-guild-org/shared-config/pull/317) 340 | [`d37d14e`](https://github.com/the-guild-org/shared-config/commit/d37d14eee9794d93b1b7129ed6244faa8b470056) 341 | Thanks [@dotansimha](https://github.com/dotansimha)! - dependencies updates: 342 | 343 | - Updated dependency 344 | [`@rushstack/eslint-patch@^1.6.1` ↗︎](https://www.npmjs.com/package/@rushstack/eslint-patch/v/1.6.1) 345 | (from `^1.3.2`, in `dependencies`) 346 | - Updated dependency 347 | [`@typescript-eslint/eslint-plugin@^6.14.0` ↗︎](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin/v/6.14.0) 348 | (from `^6.0.0`, in `dependencies`) 349 | - Updated dependency 350 | [`@typescript-eslint/parser@^6.14.0` ↗︎](https://www.npmjs.com/package/@typescript-eslint/parser/v/6.14.0) 351 | (from `^6.0.0`, in `dependencies`) 352 | - Updated dependency 353 | [`eslint-config-prettier@^9.1.0` ↗︎](https://www.npmjs.com/package/eslint-config-prettier/v/9.1.0) 354 | (from `^9.0.0`, in `dependencies`) 355 | - Updated dependency 356 | [`eslint-import-resolver-typescript@^3.6.1` ↗︎](https://www.npmjs.com/package/eslint-import-resolver-typescript/v/3.6.1) 357 | (from `^3.5.5`, in `dependencies`) 358 | - Updated dependency 359 | [`eslint-plugin-import@^2.29.1` ↗︎](https://www.npmjs.com/package/eslint-plugin-import/v/2.29.1) 360 | (from `^2.27.5`, in `dependencies`) 361 | - Updated dependency 362 | [`eslint-plugin-jsonc@^2.11.1` ↗︎](https://www.npmjs.com/package/eslint-plugin-jsonc/v/2.11.1) 363 | (from `^2.9.0`, in `dependencies`) 364 | - Updated dependency 365 | [`eslint-plugin-jsx-a11y@^6.8.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-jsx-a11y/v/6.8.0) 366 | (from `^6.7.1`, in `dependencies`) 367 | - Updated dependency 368 | [`eslint-plugin-n@^16.4.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-n/v/16.4.0) (from 369 | `^16.0.1`, in `dependencies`) 370 | - Updated dependency 371 | [`eslint-plugin-react@^7.33.2` ↗︎](https://www.npmjs.com/package/eslint-plugin-react/v/7.33.2) 372 | (from `^7.32.2`, in `dependencies`) 373 | - Updated dependency 374 | [`eslint-plugin-yml@^1.11.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-yml/v/1.11.0) 375 | (from `^1.8.0`, in `dependencies`) 376 | - Updated dependency [`eslint@^8` ↗︎](https://www.npmjs.com/package/eslint/v/8.0.0) (from 377 | `^8.24.0`, in `peerDependencies`) 378 | - Added dependency [`typescript@^5` ↗︎](https://www.npmjs.com/package/typescript/v/5.0.0) (to 379 | `peerDependencies`) 380 | 381 | - [#317](https://github.com/the-guild-org/shared-config/pull/317) 382 | [`d37d14e`](https://github.com/the-guild-org/shared-config/commit/d37d14eee9794d93b1b7129ed6244faa8b470056) 383 | Thanks [@dotansimha](https://github.com/dotansimha)! - Bump dependencies. Please note that 384 | '@typescript-eslint/prefer-optional-chain' rule needs parserServices to function 385 | 386 | ## 0.11.1 387 | 388 | ### Patch Changes 389 | 390 | - [#256](https://github.com/the-guild-org/shared-config/pull/256) 391 | [`c6ea530`](https://github.com/the-guild-org/shared-config/commit/c6ea530694448dce6c549f02f9995ea328a8ee54) 392 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 393 | 394 | - Updated dependency 395 | [`@typescript-eslint/eslint-plugin@^6.0.0` ↗︎](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin/v/6.0.0) 396 | (from `^5.61.0`, in `dependencies`) 397 | - Updated dependency 398 | [`@typescript-eslint/parser@^6.0.0` ↗︎](https://www.npmjs.com/package/@typescript-eslint/parser/v/6.0.0) 399 | (from `^5.61.0`, in `dependencies`) 400 | 401 | - [#261](https://github.com/the-guild-org/shared-config/pull/261) 402 | [`7178109`](https://github.com/the-guild-org/shared-config/commit/71781091197b842140cc9a65e743c2946aff1f50) 403 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 404 | 405 | - Updated dependency 406 | [`eslint-plugin-unicorn@^48.0.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-unicorn/v/48.0.0) 407 | (from `^47.0.0`, in `dependencies`) 408 | 409 | - [#267](https://github.com/the-guild-org/shared-config/pull/267) 410 | [`3443fc1`](https://github.com/the-guild-org/shared-config/commit/3443fc140df20b2081769ae3fde82d0c174d277b) 411 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 412 | 413 | - Updated dependency 414 | [`eslint-plugin-sonarjs@^0.21.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-sonarjs/v/0.21.0) 415 | (from `^0.19.0`, in `dependencies`) 416 | 417 | - [#268](https://github.com/the-guild-org/shared-config/pull/268) 418 | [`c1f28e1`](https://github.com/the-guild-org/shared-config/commit/c1f28e1aba3b976545af8cb2273ba63610ff170f) 419 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 420 | 421 | - Updated dependency 422 | [`eslint-config-prettier@^9.0.0` ↗︎](https://www.npmjs.com/package/eslint-config-prettier/v/9.0.0) 423 | (from `^8.8.0`, in `dependencies`) 424 | 425 | - [#295](https://github.com/the-guild-org/shared-config/pull/295) 426 | [`d089d85`](https://github.com/the-guild-org/shared-config/commit/d089d85e87ab701f12166261f0e394b2b563ad20) 427 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 428 | 429 | - Updated dependency 430 | [`eslint-plugin-unicorn@^49.0.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-unicorn/v/49.0.0) 431 | (from `^48.0.0`, in `dependencies`) 432 | 433 | - [#296](https://github.com/the-guild-org/shared-config/pull/296) 434 | [`933fcd8`](https://github.com/the-guild-org/shared-config/commit/933fcd829d0e3574d7a76f456e83ff69bfd7b888) 435 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 436 | - Updated dependency 437 | [`eslint-plugin-sonarjs@^0.23.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-sonarjs/v/0.23.0) 438 | (from `^0.21.0`, in `dependencies`) 439 | 440 | ## 0.11.0 441 | 442 | ### Minor Changes 443 | 444 | - [#255](https://github.com/the-guild-org/shared-config/pull/255) 445 | [`a68a857`](https://github.com/the-guild-org/shared-config/commit/a68a8579e65d6c67a4cf602956f32a9f305a9073) 446 | Thanks [@B2o5T](https://github.com/B2o5T)! - dependencies updates: 447 | - Updated dependency 448 | [`@rushstack/eslint-patch@^1.3.2` ↗︎](https://www.npmjs.com/package/@rushstack/eslint-patch/v/1.3.2) 449 | (from `^1.2.0`, in `dependencies`) 450 | - Updated dependency 451 | [`@typescript-eslint/eslint-plugin@^5.61.0` ↗︎](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin/v/5.61.0) 452 | (from `^5.48.1`, in `dependencies`) 453 | - Updated dependency 454 | [`@typescript-eslint/parser@^5.61.0` ↗︎](https://www.npmjs.com/package/@typescript-eslint/parser/v/5.61.0) 455 | (from `^5.48.1`, in `dependencies`) 456 | - Updated dependency 457 | [`eslint-config-prettier@^8.8.0` ↗︎](https://www.npmjs.com/package/eslint-config-prettier/v/8.8.0) 458 | (from `^8.6.0`, in `dependencies`) 459 | - Updated dependency 460 | [`eslint-import-resolver-typescript@^3.5.5` ↗︎](https://www.npmjs.com/package/eslint-import-resolver-typescript/v/3.5.5) 461 | (from `^3.5.3`, in `dependencies`) 462 | - Updated dependency 463 | [`eslint-plugin-import@^2.27.5` ↗︎](https://www.npmjs.com/package/eslint-plugin-import/v/2.27.5) 464 | (from `^2.27.0`, in `dependencies`) 465 | - Updated dependency 466 | [`eslint-plugin-jsonc@^2.9.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-jsonc/v/2.9.0) 467 | (from `^2.6.0`, in `dependencies`) 468 | - Updated dependency 469 | [`eslint-plugin-jsx-a11y@^6.7.1` ↗︎](https://www.npmjs.com/package/eslint-plugin-jsx-a11y/v/6.7.1) 470 | (from `^6.7.0`, in `dependencies`) 471 | - Updated dependency 472 | [`eslint-plugin-mdx@^2.1.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-mdx/v/2.1.0) (from 473 | `^2.0.5`, in `dependencies`) 474 | - Updated dependency 475 | [`eslint-plugin-n@^16.0.1` ↗︎](https://www.npmjs.com/package/eslint-plugin-n/v/16.0.1) (from 476 | `^16.0.0`, in `dependencies`) 477 | - Updated dependency 478 | [`eslint-plugin-react@^7.32.2` ↗︎](https://www.npmjs.com/package/eslint-plugin-react/v/7.32.2) 479 | (from `^7.32.0`, in `dependencies`) 480 | - Updated dependency 481 | [`eslint-plugin-yml@^1.8.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-yml/v/1.8.0) (from 482 | `^1.4.0`, in `dependencies`) 483 | 484 | ### Patch Changes 485 | 486 | - [#225](https://github.com/the-guild-org/shared-config/pull/225) 487 | [`9f2267b`](https://github.com/the-guild-org/shared-config/commit/9f2267bd2ce4dfc56a550430e97e5ef9254e23f8) 488 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 489 | 490 | - Updated dependency 491 | [`eslint-plugin-unicorn@^47.0.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-unicorn/v/47.0.0) 492 | (from `^46.0.0`, in `dependencies`) 493 | 494 | - [#233](https://github.com/the-guild-org/shared-config/pull/233) 495 | [`a07a94c`](https://github.com/the-guild-org/shared-config/commit/a07a94c4b98ca55ed1f75d667eba7e08db930d79) 496 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 497 | - Updated dependency 498 | [`eslint-plugin-n@^16.0.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-n/v/16.0.0) (from 499 | `^15.6.1`, in `dependencies`) 500 | 501 | ## 0.10.0 502 | 503 | ### Minor Changes 504 | 505 | - [#229](https://github.com/the-guild-org/shared-config/pull/229) 506 | [`0fe6bba`](https://github.com/the-guild-org/shared-config/commit/0fe6bbadfd249e5d10f35ee9d1d01d39b2de9d29) 507 | Thanks [@B2o5T](https://github.com/B2o5T)! - add `'import/no-useless-path-segments': 'error'` 508 | 509 | ## 0.9.0 510 | 511 | ### Minor Changes 512 | 513 | - [#205](https://github.com/the-guild-org/shared-config/pull/205) 514 | [`ebd2920`](https://github.com/the-guild-org/shared-config/commit/ebd292059888515095c59c12657860ece3f76eac) 515 | Thanks [@B2o5T](https://github.com/B2o5T)! - new rules 516 | 517 | ```json 518 | { 519 | "unicorn/no-array-for-each": "error", 520 | "unicorn/prefer-string-trim-start-end": "error", 521 | "no-self-compare": "error", 522 | "eqeqeq": [ 523 | "error", 524 | "always", 525 | { 526 | "null": "ignore" 527 | } 528 | ], 529 | "@typescript-eslint/consistent-type-assertions": "error" 530 | } 531 | ``` 532 | 533 | ### Patch Changes 534 | 535 | - [#200](https://github.com/the-guild-org/shared-config/pull/200) 536 | [`df800fc`](https://github.com/the-guild-org/shared-config/commit/df800fcf68b878fef7701aa4a92378512904c0d3) 537 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 538 | - Updated dependency 539 | [`eslint-plugin-sonarjs@^0.19.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-sonarjs/v/0.19.0) 540 | (from `^0.18.0`, in `dependencies`) 541 | 542 | ## 0.8.1 543 | 544 | ### Patch Changes 545 | 546 | - [#187](https://github.com/the-guild-org/shared-config/pull/187) 547 | [`779ad25`](https://github.com/the-guild-org/shared-config/commit/779ad25c3bbe1cb12c464171468b719b2c5bdf51) 548 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 549 | - Updated dependency 550 | [`eslint-plugin-unicorn@^46.0.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-unicorn/v/46.0.0) 551 | (from `^45.0.2`, in `dependencies`) 552 | 553 | ## 0.8.0 554 | 555 | ### Minor Changes 556 | 557 | - [#157](https://github.com/the-guild-org/shared-config/pull/157) 558 | [`3f7437f`](https://github.com/the-guild-org/shared-config/commit/3f7437f6430459661b5d40b3f6f49666042b4122) 559 | Thanks [@B2o5T](https://github.com/B2o5T)! - new rules: 560 | 561 | - `yoda` 562 | 563 | - `unicorn/prefer-export-from` 564 | 565 | - `promise/no-multiple-resolved` 566 | 567 | - `unicorn/prefer-logical-operator-over-ternary` 568 | 569 | - `@typescript-eslint/no-unused-expressions` 570 | 571 | - `unicorn/no-negated-condition` 572 | 573 | react: 574 | 575 | fix `import/extensions` 576 | 577 | - 'react/prop-types': 'off' 578 | - 'react/jsx-boolean-value': 'error' 579 | - 'react/hook-use-state': 'error' 580 | - 'react/iframe-missing-sandbox': 'error' 581 | 582 | forbid: 583 | 584 | - `process.browser` 585 | 586 | - restrict `isNaN` in favour of `Number.isNaN` 587 | 588 | ### Patch Changes 589 | 590 | - [#157](https://github.com/the-guild-org/shared-config/pull/157) 591 | [`3f7437f`](https://github.com/the-guild-org/shared-config/commit/3f7437f6430459661b5d40b3f6f49666042b4122) 592 | Thanks [@B2o5T](https://github.com/B2o5T)! - dependencies updates: 593 | - Updated dependency 594 | [`@typescript-eslint/eslint-plugin@^5.48.1` ↗︎](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin/v/5.48.1) 595 | (from `^5.45.1`, in `dependencies`) 596 | - Updated dependency 597 | [`@typescript-eslint/parser@^5.48.1` ↗︎](https://www.npmjs.com/package/@typescript-eslint/parser/v/5.48.1) 598 | (from `^5.45.1`, in `dependencies`) 599 | - Updated dependency 600 | [`eslint-config-prettier@^8.6.0` ↗︎](https://www.npmjs.com/package/eslint-config-prettier/v/8.6.0) 601 | (from `^8.5.0`, in `dependencies`) 602 | - Updated dependency 603 | [`eslint-plugin-import@^2.27.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-import/v/2.27.0) 604 | (from `^2.26.0`, in `dependencies`) 605 | - Updated dependency 606 | [`eslint-plugin-jsonc@^2.6.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-jsonc/v/2.6.0) 607 | (from `^2.5.0`, in `dependencies`) 608 | - Updated dependency 609 | [`eslint-plugin-jsx-a11y@^6.7.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-jsx-a11y/v/6.7.0) 610 | (from `^6.6.1`, in `dependencies`) 611 | - Updated dependency 612 | [`eslint-plugin-n@^15.6.1` ↗︎](https://www.npmjs.com/package/eslint-plugin-n/v/15.6.1) (from 613 | `^15.6.0`, in `dependencies`) 614 | - Updated dependency 615 | [`eslint-plugin-react@^7.32.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-react/v/7.32.0) 616 | (from `^7.31.11`, in `dependencies`) 617 | - Updated dependency 618 | [`eslint-plugin-unicorn@^45.0.2` ↗︎](https://www.npmjs.com/package/eslint-plugin-unicorn/v/45.0.2) 619 | (from `^45.0.1`, in `dependencies`) 620 | - Updated dependency 621 | [`eslint-plugin-yml@^1.4.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-yml/v/1.4.0) (from 622 | `^1.2.0`, in `dependencies`) 623 | - Added dependency 624 | [`eslint-import-resolver-typescript@^3.5.3` ↗︎](https://www.npmjs.com/package/eslint-import-resolver-typescript/v/3.5.3) 625 | (to `dependencies`) 626 | 627 | ## 0.7.0 628 | 629 | ### Minor Changes 630 | 631 | - [#154](https://github.com/the-guild-org/shared-config/pull/154) 632 | [`8e8e708`](https://github.com/the-guild-org/shared-config/commit/8e8e70847a71de1e5395c1b5a7211a910328daf0) 633 | Thanks [@enisdenjo](https://github.com/enisdenjo)! - prettier should be responsible for import 634 | sorting instead of eslint 635 | 636 | ### Patch Changes 637 | 638 | - [#154](https://github.com/the-guild-org/shared-config/pull/154) 639 | [`8e8e708`](https://github.com/the-guild-org/shared-config/commit/8e8e70847a71de1e5395c1b5a7211a910328daf0) 640 | Thanks [@enisdenjo](https://github.com/enisdenjo)! - dependencies updates: 641 | 642 | - Removed dependency 643 | [`eslint-plugin-simple-import-sort@^8.0.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-simple-import-sort/v/8.0.0) 644 | (from `dependencies`) 645 | 646 | - [#155](https://github.com/the-guild-org/shared-config/pull/155) 647 | [`71cf9c5`](https://github.com/the-guild-org/shared-config/commit/71cf9c5b7475a72a8901d22cae67d85841cfb490) 648 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 649 | - Updated dependency 650 | [`eslint-plugin-sonarjs@^0.18.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-sonarjs/v/0.18.0) 651 | (from `^0.17.0`, in `dependencies`) 652 | 653 | ## 0.6.0 654 | 655 | ### Minor Changes 656 | 657 | - [#151](https://github.com/the-guild-org/shared-config/pull/151) 658 | [`d5152a8`](https://github.com/the-guild-org/shared-config/commit/d5152a88d1e74769b2cdff580f1107a60a6faaa0) 659 | Thanks [@B2o5T](https://github.com/B2o5T)! - forbid `useMemo(…, [])` for react and `Boolean(…)` 660 | for all files 661 | 662 | ## 0.5.1 663 | 664 | ### Patch Changes 665 | 666 | - [#149](https://github.com/the-guild-org/shared-config/pull/149) 667 | [`10a328a`](https://github.com/the-guild-org/shared-config/commit/10a328a6042a68bee44594d7089d51111eda322b) 668 | Thanks [@B2o5T](https://github.com/B2o5T)! - add `boolean: false` for `no-implicit-coercion` 669 | because in TypeScript `!!` is preferable 670 | 671 | ## 0.5.0 672 | 673 | ### Minor Changes 674 | 675 | - [#146](https://github.com/the-guild-org/shared-config/pull/146) 676 | [`f829c8d`](https://github.com/the-guild-org/shared-config/commit/f829c8d285499c9bb7df7818d22570ead7112ad6) 677 | Thanks [@B2o5T](https://github.com/B2o5T)! - add new rules `prefer-object-has-own`, 678 | `logical-assignment-operators` and `@typescript-eslint/prefer-optional-chain` 679 | 680 | ## 0.4.2 681 | 682 | ### Patch Changes 683 | 684 | - [#144](https://github.com/the-guild-org/shared-config/pull/144) 685 | [`2e7099a`](https://github.com/the-guild-org/shared-config/commit/2e7099a27f74c1f9bacf38e2488b1fc547b7eaed) 686 | Thanks [@B2o5T](https://github.com/B2o5T)! - add `varsIgnorePattern: '^_'` for 687 | `@typescript-eslint/no-unused-vars` forbid lodash/isString.js, lodash/isArray.js, 688 | lodash/flatten.js, lodash/compact.js, lodash/identity.js 689 | 690 | ## 0.4.1 691 | 692 | ### Patch Changes 693 | 694 | - [#142](https://github.com/the-guild-org/shared-config/pull/142) 695 | [`b09a4ce`](https://github.com/the-guild-org/shared-config/commit/b09a4cef20c7aab5af3267803fdad323814717fe) 696 | Thanks [@B2o5T](https://github.com/B2o5T)! - ignore `import/no-default-export` for 697 | `website/theme.config.tsx` treat `.vscode/launch.json` as jsonc ignore `import/extensions` for 698 | Markdown code blocks ignore filename for `.github/FUNDING.yml` put imported filename extensions 699 | `graphql|css|png|svg|jpe?g|webp|avif` always last 700 | 701 | ## 0.4.0 702 | 703 | ### Minor Changes 704 | 705 | - [#122](https://github.com/the-guild-org/shared-config/pull/122) 706 | [`cb4c789`](https://github.com/the-guild-org/shared-config/commit/cb4c789053e52d4af6e210fb9c6bed9c710988f2) 707 | Thanks [@B2o5T](https://github.com/B2o5T)! - run react rule on js/ts files, since it can be react 708 | hook without JSX extension 709 | 710 | ### Patch Changes 711 | 712 | - [#122](https://github.com/the-guild-org/shared-config/pull/122) 713 | [`cb4c789`](https://github.com/the-guild-org/shared-config/commit/cb4c789053e52d4af6e210fb9c6bed9c710988f2) 714 | Thanks [@B2o5T](https://github.com/B2o5T)! - dependencies updates: 715 | 716 | - Updated dependency 717 | [`@typescript-eslint/eslint-plugin@^5.45.1` ↗︎](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin/v/5.45.1) 718 | (from `^5.42.0`, in `dependencies`) 719 | - Updated dependency 720 | [`@typescript-eslint/parser@^5.45.1` ↗︎](https://www.npmjs.com/package/@typescript-eslint/parser/v/5.45.1) 721 | (from `^5.42.0`, in `dependencies`) 722 | - Updated dependency 723 | [`eslint-plugin-n@^15.6.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-n/v/15.6.0) (from 724 | `^15.4.0`, in `dependencies`) 725 | - Updated dependency 726 | [`eslint-plugin-unicorn@^45.0.1` ↗︎](https://www.npmjs.com/package/eslint-plugin-unicorn/v/45.0.1) 727 | (from `^45.0.0`, in `dependencies`) 728 | - Added dependency 729 | [`eslint-plugin-jsx-a11y@^6.6.1` ↗︎](https://www.npmjs.com/package/eslint-plugin-jsx-a11y/v/6.6.1) 730 | (to `dependencies`) 731 | - Added dependency 732 | [`eslint-plugin-mdx@^2.0.5` ↗︎](https://www.npmjs.com/package/eslint-plugin-mdx/v/2.0.5) (to 733 | `dependencies`) 734 | - Added dependency 735 | [`eslint-plugin-react@^7.31.11` ↗︎](https://www.npmjs.com/package/eslint-plugin-react/v/7.31.11) 736 | (to `dependencies`) 737 | - Added dependency 738 | [`eslint-plugin-react-hooks@^4.6.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-react-hooks/v/4.6.0) 739 | (to `dependencies`) 740 | 741 | - [#124](https://github.com/the-guild-org/shared-config/pull/124) 742 | [`1092362`](https://github.com/the-guild-org/shared-config/commit/1092362499a1462da764d65341b9cc7cc3208b62) 743 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 744 | - Updated dependency 745 | [`eslint-plugin-sonarjs@^0.17.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-sonarjs/v/0.17.0) 746 | (from `^0.16.0`, in `dependencies`) 747 | 748 | ## 0.3.1 749 | 750 | ### Patch Changes 751 | 752 | - [#108](https://github.com/the-guild-org/shared-config/pull/108) 753 | [`a00a18a`](https://github.com/the-guild-org/shared-config/commit/a00a18ad8af6c988b79208bc6ebc05dd28fd373a) 754 | Thanks [@B2o5T](https://github.com/B2o5T)! - config adjustments 755 | 756 | ## 0.3.0 757 | 758 | ### Minor Changes 759 | 760 | - [#102](https://github.com/the-guild-org/shared-config/pull/102) 761 | [`2375767`](https://github.com/the-guild-org/shared-config/commit/237576757b30002fc190f5b0ef397b76443c2fff) 762 | Thanks [@B2o5T](https://github.com/B2o5T)! - add mdx/md linting 763 | 764 | - [#99](https://github.com/the-guild-org/shared-config/pull/99) 765 | [`83fd0d8`](https://github.com/the-guild-org/shared-config/commit/83fd0d8636ea2975ead28fa2991e0d72f0d666f2) 766 | Thanks [@B2o5T](https://github.com/B2o5T)! - update eslint config, add new rules 767 | 768 | ### Patch Changes 769 | 770 | - [#102](https://github.com/the-guild-org/shared-config/pull/102) 771 | [`2375767`](https://github.com/the-guild-org/shared-config/commit/237576757b30002fc190f5b0ef397b76443c2fff) 772 | Thanks [@B2o5T](https://github.com/B2o5T)! - dependencies updates: 773 | 774 | - Updated dependency 775 | [`@rushstack/eslint-patch@^1.2.0` ↗︎](https://www.npmjs.com/package/@rushstack/eslint-patch/v/1.2.0) 776 | (from `^1.1.4`, in `dependencies`) 777 | - Updated dependency 778 | [`@typescript-eslint/eslint-plugin@^5.42.0` ↗︎](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin/v/5.42.0) 779 | (from `^5.36.2`, in `dependencies`) 780 | - Updated dependency 781 | [`@typescript-eslint/parser@^5.42.0` ↗︎](https://www.npmjs.com/package/@typescript-eslint/parser/v/5.42.0) 782 | (from `^5.36.2`, in `dependencies`) 783 | - Updated dependency 784 | [`eslint-plugin-n@^15.4.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-n/v/15.4.0) (from 785 | `^15.3.0`, in `dependencies`) 786 | - Updated dependency 787 | [`eslint-plugin-promise@^6.1.1` ↗︎](https://www.npmjs.com/package/eslint-plugin-promise/v/6.1.1) 788 | (from `^6.0.1`, in `dependencies`) 789 | - Updated dependency 790 | [`eslint-plugin-unicorn@^44.0.2` ↗︎](https://www.npmjs.com/package/eslint-plugin-unicorn/v/44.0.2) 791 | (from `^44.0.0`, in `dependencies`) 792 | - Added dependency 793 | [`eslint-plugin-jsonc@^2.5.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-jsonc/v/2.5.0) 794 | (to `dependencies`) 795 | - Added dependency 796 | [`eslint-plugin-yml@^1.2.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-yml/v/1.2.0) (to 797 | `dependencies`) 798 | 799 | - [#115](https://github.com/the-guild-org/shared-config/pull/115) 800 | [`6550d7a`](https://github.com/the-guild-org/shared-config/commit/6550d7a98dce7bb5cd1d7137800ec75c91954a3e) 801 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 802 | 803 | - Updated dependency 804 | [`eslint-plugin-unicorn@^45.0.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-unicorn/v/45.0.0) 805 | (from `^44.0.2`, in `dependencies`) 806 | 807 | - [#99](https://github.com/the-guild-org/shared-config/pull/99) 808 | [`83fd0d8`](https://github.com/the-guild-org/shared-config/commit/83fd0d8636ea2975ead28fa2991e0d72f0d666f2) 809 | Thanks [@B2o5T](https://github.com/B2o5T)! - dependencies updates: 810 | 811 | - Added dependency 812 | [`eslint-plugin-n@^15.3.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-n/v/15.3.0) (to 813 | `dependencies`) 814 | - Added dependency 815 | [`eslint-plugin-simple-import-sort@^8.0.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-simple-import-sort/v/8.0.0) 816 | (to `dependencies`) 817 | 818 | ## 0.2.0 819 | 820 | ### Minor Changes 821 | 822 | - [#77](https://github.com/the-guild-org/shared-config/pull/77) 823 | [`d63132c`](https://github.com/the-guild-org/shared-config/commit/d63132c099aab495caa67b3050557b42a5f1b938) 824 | Thanks [@saihaj](https://github.com/saihaj)! - require to have `.js` extensions since when 825 | bundling with `bob` we need all the extensions to be explicit. 826 | 827 | ## 0.1.2 828 | 829 | ### Patch Changes 830 | 831 | - [#63](https://github.com/the-guild-org/shared-config/pull/63) 832 | [`6769c59`](https://github.com/the-guild-org/shared-config/commit/6769c596bf13bd1314a4fc12e2dd105de5c82f55) 833 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 834 | 835 | - Updated dependency 836 | [`eslint-plugin-unicorn@^44.0.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-unicorn/v/44.0.0) 837 | (from `^43.0.2`, in `dependencies`) 838 | 839 | - [#73](https://github.com/the-guild-org/shared-config/pull/73) 840 | [`570f65a`](https://github.com/the-guild-org/shared-config/commit/570f65a26e22049abc1a5a27c7f3ccb5f39d8e7a) 841 | Thanks [@B2o5T](https://github.com/B2o5T)! - add `package.json` to `exports` field 842 | 843 | ## 0.1.1 844 | 845 | ### Patch Changes 846 | 847 | - [#68](https://github.com/the-guild-org/shared-config/pull/68) 848 | [`97edf94`](https://github.com/the-guild-org/shared-config/commit/97edf94a4b5d77dee80381fe5395d96f5c6db13d) 849 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 850 | - Updated dependency 851 | [`eslint-plugin-sonarjs@^0.16.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-sonarjs/v/0.16.0) 852 | (from `^0.15.0`, in `dependencies`) 853 | 854 | ## 0.1.0 855 | 856 | ### Minor Changes 857 | 858 | - [#50](https://github.com/the-guild-org/shared-config/pull/50) 859 | [`3f642fd`](https://github.com/the-guild-org/shared-config/commit/3f642fd029f946fe3013066b6c1545507ffbeba5) 860 | Thanks [@B2o5T](https://github.com/B2o5T)! - update deps 861 | 862 | ### Patch Changes 863 | 864 | - [#50](https://github.com/the-guild-org/shared-config/pull/50) 865 | [`3f642fd`](https://github.com/the-guild-org/shared-config/commit/3f642fd029f946fe3013066b6c1545507ffbeba5) 866 | Thanks [@B2o5T](https://github.com/B2o5T)! - dependencies updates: 867 | 868 | - Updated dependency 869 | [`@rushstack/eslint-patch@^1.1.4` ↗︎](https://www.npmjs.com/package/@rushstack/eslint-patch/v/null) 870 | (from `^1.1.3`, in `dependencies`) 871 | - Updated dependency 872 | [`@typescript-eslint/eslint-plugin@^5.36.2` ↗︎](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin/v/null) 873 | (from `^5.23.0`, in `dependencies`) 874 | - Updated dependency 875 | [`@typescript-eslint/parser@^5.36.2` ↗︎](https://www.npmjs.com/package/@typescript-eslint/parser/v/null) 876 | (from `^5.23.0`, in `dependencies`) 877 | - Updated dependency 878 | [`eslint-plugin-promise@^6.0.1` ↗︎](https://www.npmjs.com/package/eslint-plugin-promise/v/null) 879 | (from `^6.0.0`, in `dependencies`) 880 | - Updated dependency 881 | [`eslint-plugin-unicorn@^43.0.2` ↗︎](https://www.npmjs.com/package/eslint-plugin-unicorn/v/null) 882 | (from `^42.0.0`, in `dependencies`) 883 | 884 | ## 0.0.2 885 | 886 | ### Patch Changes 887 | 888 | - [#26](https://github.com/the-guild-org/shared-config/pull/26) 889 | [`d650d86`](https://github.com/the-guild-org/shared-config/commit/d650d86fe164f52b17a0486ab8fcf721b205235e) 890 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 891 | 892 | - Updated dependency 893 | [`eslint-plugin-sonarjs@^0.15.0` ↗︎](https://www.npmjs.com/package/eslint-plugin-sonarjs/v/^0.15.0) 894 | (was `^0.13.0`, in `dependencies`) 895 | 896 | ## 0.0.1 897 | 898 | ### Patch Changes 899 | 900 | - f86543d: first alpha 901 | -------------------------------------------------------------------------------- /packages/eslint-config/README.md: -------------------------------------------------------------------------------- 1 | # @theguild/eslint-config 2 | 3 | Guild's ESLint shareable configs for linting JavaScript/TypeScript/React projects. 4 | 5 | ## Install 6 | 7 | For JavaScript/TypeScript projects 8 | 9 | ```sh 10 | pnpm add -D eslint @theguild/eslint-config 11 | ``` 12 | 13 | ## Usage 14 | 15 | Extend a `@theguild` config for JavaScript/TypeScript projects. 16 | 17 | ```js 18 | // .eslintrc.cjs 19 | module.exports = { 20 | extends: ['@theguild'] 21 | } 22 | ``` 23 | 24 | ### React Config 25 | 26 | Extend a `@theguild/eslint-config/react` config for React projects. 27 | 28 | ```js 29 | // .eslintrc.cjs 30 | module.exports = { 31 | extends: ['@theguild/eslint-config/react'] 32 | } 33 | ``` 34 | 35 | ### MDX/Markdown Config 36 | 37 | Extend a `@theguild/eslint-config/mdx` config for `.md`/`.mdx` files. 38 | 39 | ```js 40 | // .eslintrc.cjs 41 | module.exports = { 42 | extends: ['@theguild/eslint-config/mdx'] 43 | } 44 | ``` 45 | 46 | ### JSON Config 47 | 48 | Extend a `@theguild/eslint-config/json` config for `.json`/`.jsonc`/`.json5` files. 49 | 50 | ```js 51 | // .eslintrc.cjs 52 | module.exports = { 53 | extends: ['@theguild/eslint-config/json'] 54 | } 55 | ``` 56 | 57 | ### YAML Config 58 | 59 | Extend a `@theguild/eslint-config/yml` config for `.yml`/`.yaml` files. 60 | 61 | ```js 62 | // .eslintrc.cjs 63 | module.exports = { 64 | extends: ['@theguild/eslint-config/yml'] 65 | } 66 | ``` 67 | -------------------------------------------------------------------------------- /packages/eslint-config/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@theguild/eslint-config", 3 | "version": "0.13.4", 4 | "type": "commonjs", 5 | "description": "The Guild's shared ESLint config", 6 | "repository": { 7 | "url": "the-guild-org/shared-config", 8 | "directory": "packages/eslint-config" 9 | }, 10 | "author": "The Guild (https://the-guild.dev)", 11 | "license": "MIT", 12 | "private": false, 13 | "exports": { 14 | ".": "./src/index.js", 15 | "./*": "./src/*.js", 16 | "./package.json": "./package.json" 17 | }, 18 | "keywords": [ 19 | "eslint", 20 | "eslint-config" 21 | ], 22 | "peerDependencies": { 23 | "eslint": "^8 || ^9", 24 | "typescript": "^5" 25 | }, 26 | "dependencies": { 27 | "@rushstack/eslint-patch": "1.11.0", 28 | "@typescript-eslint/eslint-plugin": "8.26.1", 29 | "@typescript-eslint/parser": "8.26.1", 30 | "eslint-config-prettier": "10.1.1", 31 | "eslint-import-resolver-typescript": "4.2.1", 32 | "eslint-plugin-import": "2.31.0", 33 | "eslint-plugin-jsonc": "2.19.1", 34 | "eslint-plugin-jsx-a11y": "6.10.2", 35 | "eslint-plugin-mdx": "3.2.0", 36 | "eslint-plugin-n": "17.16.2", 37 | "eslint-plugin-promise": "7.2.1", 38 | "eslint-plugin-react": "7.37.4", 39 | "eslint-plugin-react-hooks": "5.2.0", 40 | "eslint-plugin-sonarjs": "3.0.2", 41 | "eslint-plugin-unicorn": "57.0.0", 42 | "eslint-plugin-yml": "1.17.0" 43 | }, 44 | "publishConfig": { 45 | "access": "public" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /packages/eslint-config/src/base.js: -------------------------------------------------------------------------------- 1 | const { RESTRICTED_SYNTAX, RESTRICTED_GLOBALS, RESTRICTED_MODULES } = require('./constants.js'); 2 | 3 | /** @type {import('eslint').Linter.Config} */ 4 | module.exports = { 5 | extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'], 6 | plugins: ['sonarjs', 'unicorn', 'promise', 'import', 'n'], 7 | rules: { 8 | // Disallows if statements as the only statement in else blocks 9 | // https://eslint.org/docs/rules/no-lonely-if 10 | 'no-lonely-if': 'error', 11 | // Disallows the use of console 12 | // https://eslint.org/docs/rules/no-console 13 | 'no-console': 'error', 14 | // Requires method and property shorthand syntax for object literals 15 | // https://eslint.org/docs/rules/object-shorthand 16 | 'object-shorthand': ['error', 'always'], 17 | // Disallows loops with a body that allows only one iteration 18 | // https://eslint.org/docs/rules/no-unreachable-loop 19 | 'no-unreachable-loop': 'error', 20 | 'sonarjs/no-one-iteration-loop': 'off', // similar to 'no-unreachable-loop' but reports less cases 21 | 'prefer-arrow-callback': ['error', { allowNamedFunctions: true }], 22 | 23 | 'sonarjs/no-unused-collection': 'error', 24 | 'sonarjs/no-identical-conditions': 'error', 25 | 'sonarjs/no-inverted-boolean-check': 'error', 26 | 'sonarjs/no-use-of-empty-return-value': 'error', 27 | 'sonarjs/no-gratuitous-expressions': 'error', 28 | 'sonarjs/no-nested-switch': 'error', 29 | 'unicorn/no-lonely-if': 'error', 30 | 'sonarjs/no-collapsible-if': 'off', // same as 'unicorn/no-lonely-if' 31 | 'unicorn/no-array-push-push': 'error', 32 | 'unicorn/no-instanceof-array': 'error', 33 | 'unicorn/no-empty-file': 'error', 34 | 'unicorn/no-useless-fallback-in-spread': 'error', 35 | 'unicorn/prefer-array-find': 'error', 36 | 'unicorn/no-useless-spread': 'error', 37 | 'unicorn/prefer-includes': 'error', 38 | 39 | // Disallows specified syntax 40 | // https://eslint.org/docs/rules/no-restricted-syntax 41 | 'no-restricted-syntax': ['error', ...RESTRICTED_SYNTAX], 42 | 'no-else-return': ['error', { allowElseIf: false }], 43 | 'promise/no-nesting': 'error', 44 | 45 | 'import/extensions': ['error', 'ignorePackages'], // Bob when bundling requires to have `.js` extension 46 | 'import/no-default-export': 'error', 47 | 'import/prefer-default-export': 'off', // disable opposite of 'import/no-default-export' 48 | 'unicorn/filename-case': 'error', 49 | 50 | '@typescript-eslint/no-unused-vars': [ 51 | 'error', 52 | { 53 | argsIgnorePattern: '^_', 54 | varsIgnorePattern: '^_', // allow underscores in destructuring 55 | }, 56 | ], 57 | 58 | // Enforce the style of numeric separators by correctly grouping digits 59 | // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/numeric-separators-style.md 60 | 'unicorn/numeric-separators-style': 'error', 61 | // Prefer using the node: protocol when importing Node.js builtin modules 62 | // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md 63 | 'unicorn/prefer-node-protocol': 'error', 64 | // Reports any imports that come after non-import statements 65 | // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/first.md 66 | 'import/first': 'error', 67 | // Disallow shorthand type conversions 68 | // https://eslint.org/docs/latest/rules/no-implicit-coercion 69 | 'no-implicit-coercion': [ 70 | 'error', 71 | { 72 | disallowTemplateShorthand: true, 73 | // in TypeScript `!!` is preferable https://www.typescriptlang.org/docs/handbook/2/narrowing.html#truthiness-narrowing 74 | boolean: false, 75 | }, 76 | ], 77 | // Disallow specified modules when loaded by `import` declarations 78 | // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-restricted-import.md 79 | 'n/no-restricted-import': ['error', RESTRICTED_MODULES], 80 | // Disallow specified modules when loaded by require 81 | // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-restricted-require.md 82 | 'n/no-restricted-require': ['error', RESTRICTED_MODULES], 83 | 'no-restricted-modules': 'off', // deprecated in favor of corresponding rules from `eslint-plugin-n` 84 | 85 | // Disallow specified global variables 86 | // https://eslint.org/docs/latest/rules/no-restricted-globals 87 | 'no-restricted-globals': ['error', ...RESTRICTED_GLOBALS], 88 | 89 | '@typescript-eslint/no-explicit-any': 'error', 90 | 'prefer-const': ['error', { destructuring: 'all' }], 91 | 92 | 'import/no-duplicates': 'error', 93 | 'import/newline-after-import': 'off', // prettified by prettier-plugin-sort-imports 94 | 95 | 'prefer-object-has-own': 'error', 96 | 'logical-assignment-operators': ['error', 'always', { enforceForIfStatements: true }], 97 | 98 | yoda: 'error', 99 | 'unicorn/prefer-export-from': ['error', { ignoreUsedVariables: true }], 100 | 'promise/no-multiple-resolved': 'error', 101 | 'unicorn/prefer-logical-operator-over-ternary': 'error', 102 | 'no-unused-expressions': 'off', 103 | '@typescript-eslint/no-unused-expressions': 'error', 104 | 'no-negated-condition': 'off', 105 | 'unicorn/no-negated-condition': 'error', // has autofix 106 | 107 | 'unicorn/no-array-for-each': 'error', 108 | 'unicorn/prefer-string-trim-start-end': 'error', 109 | 'no-self-compare': 'error', 110 | eqeqeq: ['error', 'always', { null: 'ignore' }], 111 | 112 | 'import/no-useless-path-segments': 'error', 113 | 114 | // 'prefer-destructuring': [ // TODO: Rediscuss later 115 | // 'error', 116 | // { 117 | // VariableDeclarator: { array: false, object: true }, 118 | // AssignmentExpression: { array: true, object: false }, 119 | // }, 120 | // { enforceForRenamedProperties: false }, 121 | // ], 122 | 123 | 'require-await': 'off', 124 | // Disallow async functions which have no await expression 125 | // https://typescript-eslint.io/rules/require-await/ 126 | // '@typescript-eslint/require-await': 'error', // TODO: enable 127 | 128 | 'no-return-await': 'off', 129 | // Enforce consistent returning of awaited values. 130 | // https://typescript-eslint.io/rules/return-await/ 131 | // '@typescript-eslint/return-await': 'error', // TODO: enable 132 | }, 133 | }; 134 | -------------------------------------------------------------------------------- /packages/eslint-config/src/constants.js: -------------------------------------------------------------------------------- 1 | const RESTRICTED_SYNTAX = [ 2 | { 3 | // ❌ readFile(…, { encoding: … }) 4 | selector: 5 | 'CallExpression[callee.name=/readFileSync|readFile|writeFileSync|writeFile/] > .arguments:last-child[type=ObjectExpression][properties.length=1] Property[key.name=encoding]', 6 | message: 'Specify encoding as last argument instead of object with encoding key', 7 | }, 8 | { 9 | // ❌ readFile(…, {}) 10 | selector: 11 | 'CallExpression[callee.name=/readFileSync|readFile|writeFileSync|writeFile/] > .arguments:last-child[type=ObjectExpression][properties.length=0]', 12 | message: 'Specify encoding as last argument', 13 | }, 14 | { 15 | // ❌ readFileSync(…).toString(…) 16 | selector: 'CallExpression[callee.name=readFileSync][parent.property.name=toString]', 17 | message: 'toString is redundant, specify encoding as last argument', 18 | }, 19 | { 20 | // ❌ ….readFile(…, { encoding: … }) 21 | selector: 22 | 'CallExpression[callee.type=MemberExpression][callee.property.name=/readFileSync|readFile|writeFileSync|writeFile/] > .arguments:last-child[type=ObjectExpression][properties.length=1] Property[key.name=encoding]', 23 | message: 'Specify encoding as last argument instead of object with encoding key', 24 | }, 25 | { 26 | // ❌ ….readFile(…, {}) 27 | selector: 28 | 'CallExpression[callee.type=MemberExpression][callee.property.name=/readFileSync|readFile|writeFileSync|writeFile/] > .arguments:last-child[type=ObjectExpression][properties.length=0]', 29 | message: 'Specify encoding as last argument', 30 | }, 31 | { 32 | // ❌ Boolean(…) 33 | selector: 'CallExpression[callee.name=Boolean][arguments.1.elements.length!=0]', 34 | message: 35 | 'Prefer `!!…` over `Boolean(…)` because TypeScript infers a narrow literal boolean `type: true` instead of `type: boolean`.', 36 | }, 37 | { 38 | // ❌ process.browser 39 | selector: 40 | 'ExpressionStatement[expression.object.name=process][expression.property.name=browser]', 41 | message: '`process.browser` is deprecated, use `!!globalThis.window`', 42 | }, 43 | // { 44 | // // ❌ let { foo: { bar } } = baz 45 | // // ✅ let { bar } = baz.foo 46 | // // ✅ let { foo: { bar } } = await baz 47 | // selector: 48 | // 'VariableDeclarator[init.type!=AwaitExpression] > ObjectPattern[properties.length=1][properties.0.value.type=ObjectPattern]', 49 | // message: 'Do not use nested destructuring.', 50 | // }, 51 | ]; 52 | 53 | const REACT_RESTRICTED_SYNTAX = [ 54 | ...RESTRICTED_SYNTAX, 55 | { 56 | // ❌ useMemo(…, []) 57 | selector: 58 | 'CallExpression[callee.name=useMemo][arguments.1.type=ArrayExpression][arguments.1.elements.length=0]', 59 | message: 60 | "`useMemo` with an empty dependency array can't provide a stable reference, use `useRef` instead.", 61 | }, 62 | ]; 63 | 64 | const RESTRICTED_GLOBALS = [ 65 | 'stop', 66 | 'close', 67 | { name: 'isNaN', message: 'Use Number.isNaN instead' }, 68 | ]; 69 | 70 | const RESTRICTED_MODULES = [ 71 | { name: 'axios', message: 'Use `fetch/node-fetch` instead.' }, 72 | { name: 'moment', message: 'Use `dayjs/date-fns` instead.' }, 73 | { name: 'classnames', message: 'Use `clsx` instead because he is faster.' }, 74 | { name: 'lodash/isString.js', message: "Use `typeof yourVar === 'string'` instead." }, 75 | { name: 'lodash/isArray.js', message: 'Use `Array.isArray` instead.' }, 76 | { name: 'lodash/flatten.js', message: 'Use `Array#flat()` instead.' }, 77 | { name: 'lodash/compact.js', message: 'Use `Array#filter(Boolean)` instead.' }, 78 | { name: 'lodash/identity.js', message: 'Use `(value) => value` instead.' }, 79 | ]; 80 | 81 | module.exports = { 82 | CODE_BLOCK: '**/*.md{,x}/*', 83 | CODE_FILE: '*.{,c,m}{j,t}s{,x}', 84 | TS_FILE: '*.{,c,m}ts{,x}', 85 | RESTRICTED_GLOBALS, 86 | RESTRICTED_MODULES, 87 | RESTRICTED_SYNTAX, 88 | REACT_RESTRICTED_SYNTAX, 89 | }; 90 | -------------------------------------------------------------------------------- /packages/eslint-config/src/cspell.config.js: -------------------------------------------------------------------------------- 1 | const ignoreWords = [ 2 | // libraries 3 | 'clsx', 4 | 'cssnano', 5 | 'tailwindcss', 6 | 'Nextra', 7 | 'tsup', 8 | 'sonarjs', 9 | 'CodeGen', 10 | 'GitHunt', 11 | 'pnpm', 12 | 'rushstack', 13 | 'supertokens', 14 | 'turborepo', 15 | 'esbuild', 16 | 'dockest', 17 | 'clickhouse', 18 | 'pulumi', 19 | 'slonik', 20 | 21 | // users 22 | 'kamil', 23 | 'theguild', 24 | 'kamilkisiela', 25 | 'urigo', 26 | 'ardatan', 27 | 'maticzav', 28 | 'dimatill', 29 | 'dotansimha', 30 | 'saihaj', 31 | 32 | // valid spellings 33 | 'rediscuss', 34 | 'styleguide', 35 | 'automerge', 36 | 'ingestor', 37 | 'testkit', 38 | 'sourcemaps', 39 | 40 | // others 41 | 'cjsx', 42 | 'mjsx', 43 | 'ctsx', 44 | 'mtsx', 45 | ]; 46 | 47 | module.exports = { 48 | ignoreWords, 49 | }; 50 | -------------------------------------------------------------------------------- /packages/eslint-config/src/index.js: -------------------------------------------------------------------------------- 1 | const { CODE_FILE, TS_FILE, CODE_BLOCK } = require('./constants.js'); 2 | 3 | require('@rushstack/eslint-patch/modern-module-resolution'); 4 | 5 | /** @type {import('eslint').Linter.Config} */ 6 | module.exports = { 7 | reportUnusedDisableDirectives: true, 8 | ignorePatterns: [ 9 | '!.*', // Don't ignore dot-files because by default ESLint ignore dot-files (except for .eslintrc.*) and dot-folders 10 | '.git', 11 | ], 12 | overrides: [ 13 | { 14 | files: CODE_FILE, 15 | extends: './base', 16 | }, 17 | { 18 | // Rules which require type info and exclude virtual ts files extracted by `eslint-plugin-mdx` 19 | files: TS_FILE, 20 | excludedFiles: [CODE_BLOCK], 21 | parserOptions: { 22 | projectService: true, 23 | }, 24 | rules: { 25 | '@typescript-eslint/prefer-optional-chain': 'error', 26 | }, 27 | }, 28 | { 29 | files: TS_FILE, 30 | rules: { 31 | '@typescript-eslint/consistent-type-assertions': 'error', 32 | }, 33 | }, 34 | { 35 | files: ['*.c{j,t}s'], 36 | env: { node: true }, 37 | rules: { '@typescript-eslint/no-var-requires': 'off' }, 38 | }, 39 | { 40 | files: [ 41 | 'jest.config.js', 42 | 'webpack.config.js', 43 | 'bob.config.js', 44 | 'babel.config.js', 45 | 'postcss.config.{js,cjs}', 46 | 'rollup.config.js', 47 | 'next-sitemap.config.js', 48 | ], 49 | env: { node: true }, 50 | }, 51 | { 52 | files: ['*.{spec,test}.*'], 53 | env: { jest: true }, 54 | rules: { 'import/extensions': ['error', 'never'] }, 55 | }, 56 | { 57 | files: ['vite.config.ts', 'jest.config.js', '*.d.ts', 'tsup.config.ts', 'prettier.config.js'], 58 | rules: { 'import/no-default-export': 'off' }, 59 | }, 60 | { 61 | files: ['*.d.ts'], 62 | rules: { 63 | 'no-var': 'off', 64 | }, 65 | }, 66 | ], 67 | }; 68 | -------------------------------------------------------------------------------- /packages/eslint-config/src/json.js: -------------------------------------------------------------------------------- 1 | const { CODE_BLOCK } = require('./constants.js'); 2 | 3 | const JSONC_FILES = ['tsconfig.json', 'tsconfig.eslint.json', 'turbo.json', '.vscode/launch.json']; 4 | 5 | /** @type {import('eslint').Linter.Config} */ 6 | module.exports = { 7 | overrides: [ 8 | { 9 | files: '*.json', 10 | excludedFiles: JSONC_FILES, 11 | extends: 'plugin:jsonc/recommended-with-json', 12 | }, 13 | { 14 | files: ['*.jsonc', ...JSONC_FILES], 15 | extends: 'plugin:jsonc/recommended-with-jsonc', 16 | }, 17 | { 18 | files: '*.json5', 19 | extends: 'plugin:jsonc/recommended-with-json5', 20 | }, 21 | { 22 | files: '*.json{,c,5}', 23 | excludedFiles: CODE_BLOCK, 24 | plugins: ['unicorn'], 25 | rules: { 26 | 'unicorn/filename-case': 'error', 27 | }, 28 | }, 29 | ], 30 | }; 31 | -------------------------------------------------------------------------------- /packages/eslint-config/src/mdx.js: -------------------------------------------------------------------------------- 1 | const { CODE_BLOCK } = require('./constants.js'); 2 | 3 | /** @type {import('eslint').Linter.Config} */ 4 | module.exports = { 5 | overrides: [ 6 | { 7 | files: '*.md{,x}', 8 | parser: 'eslint-mdx', 9 | processor: 'mdx/remark', 10 | plugins: ['mdx'], 11 | extends: ['./base', './react-base'], 12 | parserOptions: { 13 | ecmaVersion: 13, 14 | }, 15 | rules: { 16 | 'react/self-closing-comp': 'off', // TODO: false positive https://github.com/mdx-js/eslint-mdx/issues/437 17 | 'mdx/remark': 'error', 18 | 'import/no-default-export': 'off', 19 | '@typescript-eslint/prefer-optional-chain': 'off', // throws "parserOptions.project" error 20 | 'react/jsx-filename-extension': 'off', // fixes JSX not allowed in files with extension '.mdx' 21 | }, 22 | settings: { 23 | 'mdx/code-blocks': true, 24 | }, 25 | }, 26 | // Disable filename check 27 | { 28 | files: [ 29 | CODE_BLOCK, 30 | '.changeset/*.md', 31 | 'CHANGELOG.md', 32 | '.github/**/PULL_REQUEST_TEMPLATE.md', 33 | '.github/ISSUE_TEMPLATE/bug_report.md', 34 | 'SECURITY.md', 35 | 'CODE_OF_CONDUCT.md', 36 | 'README.md', 37 | ], 38 | rules: { 39 | 'unicorn/filename-case': 'off', 40 | }, 41 | }, 42 | // Disable rules for code blocks 43 | { 44 | files: [CODE_BLOCK], 45 | rules: { 46 | 'no-console': 'off', 47 | '@typescript-eslint/no-unused-vars': 'off', 48 | 'no-undef': 'off', 49 | 'import/extensions': 'off', 50 | }, 51 | }, 52 | // Disable rules that requires types information 53 | { 54 | files: ['*.md{,x}', '**/*.md{,x}/*'], 55 | rules: { 56 | '@typescript-eslint/require-await': 'off', 57 | '@typescript-eslint/return-await': 'off', 58 | }, 59 | }, 60 | ], 61 | }; 62 | -------------------------------------------------------------------------------- /packages/eslint-config/src/react-base.js: -------------------------------------------------------------------------------- 1 | const { REACT_RESTRICTED_SYNTAX } = require('./constants.js'); 2 | 3 | const RESTRICTED_IMPORTS = [ 4 | { 5 | name: 'react', 6 | importNames: ['PropsWithChildren'], 7 | message: 8 | '`PropsWithChildren` set `children` as optional, explicitly define `children` field in your type', 9 | }, 10 | ]; 11 | 12 | /** @type {import('eslint').Linter.Config} */ 13 | module.exports = { 14 | settings: { 15 | react: { 16 | version: 'detect', 17 | }, 18 | }, 19 | env: { 20 | browser: true, 21 | }, 22 | plugins: ['import', 'unicorn'], 23 | extends: [ 24 | 'plugin:react/recommended', 25 | 'plugin:react/jsx-runtime', 26 | 'plugin:react-hooks/recommended', 27 | 'plugin:jsx-a11y/recommended', 28 | 'plugin:import/typescript', 29 | 'prettier', 30 | ], 31 | rules: { 32 | // Disallow unnecessary JSX expressions when literals alone are sufficient 33 | // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md 34 | 'react/jsx-curly-brace-presence': 'error', 35 | 'react/jsx-no-literals': 'off', // opposite of `react/jsx-curly-brace-presence` 36 | // Disallows specific imports 37 | // https://typescript-eslint.io/rules/no-restricted-imports 38 | '@typescript-eslint/no-restricted-imports': ['error', ...RESTRICTED_IMPORTS], 39 | // Disallow extra closing tags for components without children 40 | // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md 41 | 'react/self-closing-comp': 'error', 42 | 'react/jsx-no-useless-fragment': 'error', 43 | 'react/no-unused-state': 'error', 44 | 'react/no-unescaped-entities': 'off', // annoying 45 | 'react/jsx-no-undef': 'off', // same as `no-undef` 46 | 'import/extensions': ['error', 'ignorePackages', { tsx: 'never', ts: 'never' }], 47 | 'no-restricted-syntax': ['error', ...REACT_RESTRICTED_SYNTAX], 48 | // Disallow file extensions that may contain JSX 49 | // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md 50 | 'react/jsx-filename-extension': ['error', { extensions: ['.tsx', '.jsx'], allow: 'as-needed' }], 51 | 'unicorn/filename-case': ['error', { case: 'kebabCase', ignore: [/^\[\w+]\.tsx?$/] }], 52 | 'react/prop-types': 'off', 53 | 'react/jsx-boolean-value': 'error', 54 | 'react/hook-use-state': 'error', 55 | 'react/iframe-missing-sandbox': 'error', 56 | 57 | // TODO: add in base config 58 | 'prefer-destructuring': ['error', { VariableDeclarator: { object: true } }], 59 | quotes: ['error', 'single', { avoidEscape: true }], // Matches Prettier, but also replaces backticks 60 | }, 61 | }; 62 | -------------------------------------------------------------------------------- /packages/eslint-config/src/react.js: -------------------------------------------------------------------------------- 1 | const { CODE_FILE } = require('./constants.js'); 2 | 3 | /** @type {import('eslint').Linter.Config} */ 4 | module.exports = { 5 | ignorePatterns: ['next-env.d.ts'], 6 | overrides: [ 7 | { 8 | files: CODE_FILE, 9 | extends: './react-base', 10 | }, 11 | { 12 | files: [ 13 | '**/pages/**', // Next.js' `pages` directory use default export 14 | '**/app/**/{layout,page,not-found,manifest}.{ts,tsx}', // Next.js' `layout`/`page`/`not-found` components use default export 15 | '**/app/**/_meta.{ts,tsx}', // Nextra's `_meta` file uses default export 16 | '**/app/_meta.global.{ts,tsx}', // Nextra's `_meta.global` file uses default export 17 | 'next.config.{js,mjs,ts}', 18 | '**/*.stories.{ts,tsx}', 19 | '.storybook/main.ts', 20 | 'website/theme.config.tsx', 21 | 'postcss.config.js', 22 | 'tailwind.config.ts', 23 | 'next-sitemap.config.js', 24 | ], 25 | rules: { 26 | 'import/no-default-export': 'off', 27 | }, 28 | }, 29 | { 30 | files: ['next.config.{js,mjs}'], 31 | env: { 32 | node: true, 33 | }, 34 | }, 35 | { 36 | files: ['**/*.stories.{ts,tsx}'], 37 | rules: { 38 | 'no-console': 'off', 39 | }, 40 | }, 41 | ], 42 | }; 43 | -------------------------------------------------------------------------------- /packages/eslint-config/src/yml.js: -------------------------------------------------------------------------------- 1 | const { CODE_BLOCK } = require('./constants.js'); 2 | 3 | /** @type {import('eslint').Linter.Config} */ 4 | module.exports = { 5 | ignorePatterns: ['pnpm-lock.yaml'], 6 | overrides: [ 7 | { 8 | files: '*.y{,a}ml', 9 | excludedFiles: [CODE_BLOCK, '.github/FUNDING.yml'], 10 | extends: ['plugin:yml/standard', 'plugin:yml/prettier'], 11 | plugins: ['unicorn'], 12 | rules: { 13 | 'unicorn/filename-case': 'error', 14 | }, 15 | }, 16 | ], 17 | }; 18 | -------------------------------------------------------------------------------- /packages/prettier-config/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # @theguild/prettier-config 2 | 3 | ## 3.0.0 4 | 5 | ### Major Changes 6 | 7 | - a3d8e2f: add `"type": "module"` in `package.json` and export prettier config as ESM 8 | 9 | ### Patch Changes 10 | 11 | - ce14478: dependencies updates: 12 | - Updated dependency 13 | [`@ianvs/prettier-plugin-sort-imports@4.4.0` ↗︎](https://www.npmjs.com/package/@ianvs/prettier-plugin-sort-imports/v/4.4.0) 14 | (from `4.3.1`, in `dependencies`) 15 | 16 | ## 2.0.7 17 | 18 | ### Patch Changes 19 | 20 | - [#500](https://github.com/the-guild-org/shared-config/pull/500) 21 | [`60e2524`](https://github.com/the-guild-org/shared-config/commit/60e2524d676073cb53a417507a522554f8aa89ed) 22 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 23 | 24 | - Updated dependency 25 | [`@ianvs/prettier-plugin-sort-imports@4.3.0` ↗︎](https://www.npmjs.com/package/@ianvs/prettier-plugin-sort-imports/v/4.3.0) 26 | (from `4.2.1`, in `dependencies`) 27 | 28 | - [#513](https://github.com/the-guild-org/shared-config/pull/513) 29 | [`dd2d4d4`](https://github.com/the-guild-org/shared-config/commit/dd2d4d4b8d05427411eecb073ff5736f5357f7c0) 30 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 31 | 32 | - Updated dependency 33 | [`@ianvs/prettier-plugin-sort-imports@4.3.1` ↗︎](https://www.npmjs.com/package/@ianvs/prettier-plugin-sort-imports/v/4.3.1) 34 | (from `4.3.0`, in `dependencies`) 35 | 36 | - [#544](https://github.com/the-guild-org/shared-config/pull/544) 37 | [`352390c`](https://github.com/the-guild-org/shared-config/commit/352390cc9c047f564e12cdc439cc993f025a09bf) 38 | Thanks [@dimaMachina](https://github.com/dimaMachina)! - add `importAssertions` in 39 | `importOrderParserPlugins` to format files with `assert { type: 'json' }` and not throw an error 40 | 41 | ## 2.0.6 42 | 43 | ### Patch Changes 44 | 45 | - [#364](https://github.com/the-guild-org/shared-config/pull/364) 46 | [`862b10d`](https://github.com/the-guild-org/shared-config/commit/862b10d19c8934370a614c3c63e338683b23a7f7) 47 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 48 | 49 | - Updated dependency 50 | [`@ianvs/prettier-plugin-sort-imports@4.2.0` ↗︎](https://www.npmjs.com/package/@ianvs/prettier-plugin-sort-imports/v/4.2.0) 51 | (from `4.1.1`, in `dependencies`) 52 | 53 | - [#374](https://github.com/the-guild-org/shared-config/pull/374) 54 | [`54f1464`](https://github.com/the-guild-org/shared-config/commit/54f14644318fef9ec6c87218f135cb53e818c5a9) 55 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 56 | - Updated dependency 57 | [`@ianvs/prettier-plugin-sort-imports@4.2.1` ↗︎](https://www.npmjs.com/package/@ianvs/prettier-plugin-sort-imports/v/4.2.1) 58 | (from `4.2.0`, in `dependencies`) 59 | 60 | ## 2.0.5 61 | 62 | ### Patch Changes 63 | 64 | - [#327](https://github.com/the-guild-org/shared-config/pull/327) 65 | [`d96fb9e`](https://github.com/the-guild-org/shared-config/commit/d96fb9e471bd48c8d1d94e8f767e3974a2c65b59) 66 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 67 | - Updated dependency 68 | [`prettier-plugin-sh@^0.14.0` ↗︎](https://www.npmjs.com/package/prettier-plugin-sh/v/0.14.0) 69 | (from `^0.13.1`, in `dependencies`) 70 | 71 | ## 2.0.4 72 | 73 | ### Patch Changes 74 | 75 | - [`d1d0b17`](https://github.com/the-guild-org/shared-config/commit/d1d0b174409f827f60df77c4717260b7f5361bdb) 76 | Thanks [@ardatan](https://github.com/ardatan)! - Disable trailing comma for JSON files 77 | 78 | ## 2.0.3 79 | 80 | ### Patch Changes 81 | 82 | - [#317](https://github.com/the-guild-org/shared-config/pull/317) 83 | [`d37d14e`](https://github.com/the-guild-org/shared-config/commit/d37d14eee9794d93b1b7129ed6244faa8b470056) 84 | Thanks [@dotansimha](https://github.com/dotansimha)! - dependencies updates: 85 | - Updated dependency 86 | [`prettier-plugin-sh@^0.13.1` ↗︎](https://www.npmjs.com/package/prettier-plugin-sh/v/0.13.1) 87 | (from `^0.13.0`, in `dependencies`) 88 | 89 | ## 2.0.2 90 | 91 | ### Patch Changes 92 | 93 | - [#260](https://github.com/the-guild-org/shared-config/pull/260) 94 | [`95ac66a`](https://github.com/the-guild-org/shared-config/commit/95ac66a4a20e8500705fae81bc435449185f1332) 95 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 96 | 97 | - Updated dependency 98 | [`@ianvs/prettier-plugin-sort-imports@4.1.0` ↗︎](https://www.npmjs.com/package/@ianvs/prettier-plugin-sort-imports/v/4.1.0) 99 | (from `4.0.2`, in `dependencies`) 100 | 101 | - [#288](https://github.com/the-guild-org/shared-config/pull/288) 102 | [`dcf502e`](https://github.com/the-guild-org/shared-config/commit/dcf502e8fc51afbe82545a7f34715e29788de88d) 103 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 104 | - Updated dependency 105 | [`@ianvs/prettier-plugin-sort-imports@4.1.1` ↗︎](https://www.npmjs.com/package/@ianvs/prettier-plugin-sort-imports/v/4.1.1) 106 | (from `4.1.0`, in `dependencies`) 107 | 108 | ## 2.0.1 109 | 110 | ### Patch Changes 111 | 112 | - [#272](https://github.com/the-guild-org/shared-config/pull/272) 113 | [`ac46a51`](https://github.com/the-guild-org/shared-config/commit/ac46a5120b36e6b1193f6672ccbf47923eb95924) 114 | Thanks [@enisdenjo](https://github.com/enisdenjo)! - Strings for plugins instead of require 115 | statements 116 | 117 | ## 2.0.0 118 | 119 | ### Major Changes 120 | 121 | - [#254](https://github.com/the-guild-org/shared-config/pull/254) 122 | [`20eb218`](https://github.com/the-guild-org/shared-config/commit/20eb218296e24aa225a2a3957047aff6ffdbd205) 123 | Thanks [@B2o5T](https://github.com/B2o5T)! - dependencies updates: 124 | - Updated dependency 125 | [`@ianvs/prettier-plugin-sort-imports@4.0.2` ↗︎](https://www.npmjs.com/package/@ianvs/prettier-plugin-sort-imports/v/4.0.2) 126 | (from `4.0.0-alpha.3`, in `dependencies`) 127 | - Updated dependency 128 | [`prettier-plugin-pkg@^0.18.0` ↗︎](https://www.npmjs.com/package/prettier-plugin-pkg/v/0.18.0) 129 | (from `^0.17.1`, in `dependencies`) 130 | - Updated dependency 131 | [`prettier-plugin-sh@^0.13.0` ↗︎](https://www.npmjs.com/package/prettier-plugin-sh/v/0.13.0) 132 | (from `^0.12.8`, in `dependencies`) 133 | - Updated dependency [`prettier@^3` ↗︎](https://www.npmjs.com/package/prettier/v/3.0.0) (from 134 | `^2`, in `peerDependencies`) 135 | 136 | ## 1.2.0 137 | 138 | ### Minor Changes 139 | 140 | - [#228](https://github.com/the-guild-org/shared-config/pull/228) 141 | [`e899b0c`](https://github.com/the-guild-org/shared-config/commit/e899b0cba701d9b1e7fe193679a5f0a43324100b) 142 | Thanks [@enisdenjo](https://github.com/enisdenjo)! - Better prettier plugin for sorting imports 143 | 144 | ### Patch Changes 145 | 146 | - [#228](https://github.com/the-guild-org/shared-config/pull/228) 147 | [`e899b0c`](https://github.com/the-guild-org/shared-config/commit/e899b0cba701d9b1e7fe193679a5f0a43324100b) 148 | Thanks [@enisdenjo](https://github.com/enisdenjo)! - dependencies updates: 149 | - Added dependency 150 | [`@ianvs/prettier-plugin-sort-imports@4.0.0-alpha.3` ↗︎](https://www.npmjs.com/package/@ianvs/prettier-plugin-sort-imports/v/4.0.0) 151 | (to `dependencies`) 152 | - Removed dependency 153 | [`@trivago/prettier-plugin-sort-imports@^4.1.1` ↗︎](https://www.npmjs.com/package/@trivago/prettier-plugin-sort-imports/v/4.1.1) 154 | (from `dependencies`) 155 | 156 | ## 1.1.3 157 | 158 | ### Patch Changes 159 | 160 | - [`ec9c470`](https://github.com/the-guild-org/shared-config/commit/ec9c4703445a62dc1e3e58c978cd3dd359526c63) 161 | Thanks [@dotansimha](https://github.com/dotansimha)! - Bump @trivago/prettier-plugin-sort-imports 162 | 163 | ## 1.1.2 164 | 165 | ### Patch Changes 166 | 167 | - [`c307302`](https://github.com/the-guild-org/shared-config/commit/c30730275a7f442c613b7d5268da4dd2ad004950) 168 | Thanks [@dotansimha](https://github.com/dotansimha)! - Test release flow 169 | 170 | ## 1.1.1 171 | 172 | ### Patch Changes 173 | 174 | - [#157](https://github.com/the-guild-org/shared-config/pull/157) 175 | [`3f7437f`](https://github.com/the-guild-org/shared-config/commit/3f7437f6430459661b5d40b3f6f49666042b4122) 176 | Thanks [@B2o5T](https://github.com/B2o5T)! - format svg with html parser 177 | 178 | ## 1.1.0 179 | 180 | ### Minor Changes 181 | 182 | - [#154](https://github.com/the-guild-org/shared-config/pull/154) 183 | [`8e8e708`](https://github.com/the-guild-org/shared-config/commit/8e8e70847a71de1e5395c1b5a7211a910328daf0) 184 | Thanks [@enisdenjo](https://github.com/enisdenjo)! - prettier should be responsible for import 185 | sorting instead of eslint 186 | 187 | ### Patch Changes 188 | 189 | - [#154](https://github.com/the-guild-org/shared-config/pull/154) 190 | [`8e8e708`](https://github.com/the-guild-org/shared-config/commit/8e8e70847a71de1e5395c1b5a7211a910328daf0) 191 | Thanks [@enisdenjo](https://github.com/enisdenjo)! - dependencies updates: 192 | 193 | - Added dependency 194 | [`@trivago/prettier-plugin-sort-imports@^4.0.0` ↗︎](https://www.npmjs.com/package/@trivago/prettier-plugin-sort-imports/v/4.0.0) 195 | (to `dependencies`) 196 | 197 | - [#162](https://github.com/the-guild-org/shared-config/pull/162) 198 | [`19085c2`](https://github.com/the-guild-org/shared-config/commit/19085c22066663353b49e1b1618b259863d70410) 199 | Thanks [@enisdenjo](https://github.com/enisdenjo)! - Even prettier imports 200 | 201 | ## 1.0.0 202 | 203 | ### Major Changes 204 | 205 | - [#97](https://github.com/the-guild-org/shared-config/pull/97) 206 | [`332219e`](https://github.com/the-guild-org/shared-config/commit/332219e166ac43a96ce6470c5b4e9a1243f71774) 207 | Thanks [@B2o5T](https://github.com/B2o5T)! - update prettier config 208 | 209 | ### Patch Changes 210 | 211 | - [#97](https://github.com/the-guild-org/shared-config/pull/97) 212 | [`332219e`](https://github.com/the-guild-org/shared-config/commit/332219e166ac43a96ce6470c5b4e9a1243f71774) 213 | Thanks [@B2o5T](https://github.com/B2o5T)! - dependencies updates: 214 | 215 | - Added dependency 216 | [`prettier-plugin-pkg@^0.17.1` ↗︎](https://www.npmjs.com/package/prettier-plugin-pkg/v/0.17.1) 217 | (to `dependencies`) 218 | 219 | ## 0.1.1 220 | 221 | ### Patch Changes 222 | 223 | - [#73](https://github.com/the-guild-org/shared-config/pull/73) 224 | [`570f65a`](https://github.com/the-guild-org/shared-config/commit/570f65a26e22049abc1a5a27c7f3ccb5f39d8e7a) 225 | Thanks [@B2o5T](https://github.com/B2o5T)! - add `package.json` to `exports` field 226 | 227 | ## 0.1.0 228 | 229 | ### Minor Changes 230 | 231 | - [#50](https://github.com/the-guild-org/shared-config/pull/50) 232 | [`3f642fd`](https://github.com/the-guild-org/shared-config/commit/3f642fd029f946fe3013066b6c1545507ffbeba5) 233 | Thanks [@B2o5T](https://github.com/B2o5T)! - update deps 234 | 235 | ### Patch Changes 236 | 237 | - [#50](https://github.com/the-guild-org/shared-config/pull/50) 238 | [`3f642fd`](https://github.com/the-guild-org/shared-config/commit/3f642fd029f946fe3013066b6c1545507ffbeba5) 239 | Thanks [@B2o5T](https://github.com/B2o5T)! - dependencies updates: 240 | 241 | - Updated dependency 242 | [`prettier-plugin-sh@^0.12.8` ↗︎](https://www.npmjs.com/package/prettier-plugin-sh/v/null) 243 | (from `^0.12.0`, in `dependencies`) 244 | 245 | ## 0.0.3 246 | 247 | ### Patch Changes 248 | 249 | - [#26](https://github.com/the-guild-org/shared-config/pull/26) 250 | [`d650d86`](https://github.com/the-guild-org/shared-config/commit/d650d86fe164f52b17a0486ab8fcf721b205235e) 251 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 252 | 253 | - Updated dependency 254 | [`prettier-plugin-sh@^0.12.0` ↗︎](https://www.npmjs.com/package/prettier-plugin-sh/v/^0.12.0) 255 | (was `^0.11.0`, in `dependencies`) 256 | 257 | ## 0.0.2 258 | 259 | ### Patch Changes 260 | 261 | - 86ae0ca: Use `require` statements for working around the VSCode plugin being unable to resolve the 262 | plugin modules. 263 | 264 | ## 0.0.1 265 | 266 | ### Patch Changes 267 | 268 | - 73ed164: first alpha version 269 | -------------------------------------------------------------------------------- /packages/prettier-config/README.md: -------------------------------------------------------------------------------- 1 | # @theguild/prettier-config 2 | 3 | Guild's ESLint shareable configs for linting JavaScript/TypeScript/React projects. 4 | 5 | ## Install 6 | 7 | ```sh 8 | pnpm add -D prettier @theguild/prettier-config 9 | ``` 10 | 11 | ## Usage 12 | 13 | ```js 14 | // prettier.config.js 15 | import prettierConfig from '@theguild/prettier-config' 16 | 17 | export default prettierConfig 18 | ``` 19 | -------------------------------------------------------------------------------- /packages/prettier-config/index.js: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line import/no-default-export 2 | export default { 3 | trailingComma: 'all', // default to `all` in v3 4 | printWidth: 100, 5 | singleQuote: true, 6 | arrowParens: 'avoid', 7 | proseWrap: 'always', // printWidth line breaks in md/mdx 8 | overrides: [ 9 | { 10 | files: '*.md{,x}', 11 | options: { 12 | semi: false, 13 | trailingComma: 'none', 14 | }, 15 | }, 16 | { 17 | files: '*.svg', 18 | options: { 19 | parser: 'html', 20 | }, 21 | }, 22 | { files: '*.json', options: { trailingComma: 'none' } }, 23 | ], 24 | plugins: [ 25 | // for prettifying shellscript, Dockerfile, properties, gitignore, dotenv 26 | 'prettier-plugin-sh', 27 | // for sort fields in package.json 28 | 'prettier-plugin-pkg', 29 | // for sorting imports 30 | '@ianvs/prettier-plugin-sort-imports', 31 | ], 32 | importOrder: [ 33 | // React and Next. 34 | '^react(-dom)?$', 35 | '^next(/.*|$)', 36 | // Anything not matched in other groups. 37 | '', 38 | // Things that start with `@` or digit or underscore. 39 | '^(@|\\d|_)', 40 | // Anything that starts with a dot, or multiple dots, and doesn't have the "other files" extensions. 41 | '^(?=\\.+)(.(?!\\.(graphql|css|png|svg|jpe?g|webp|avif|wasm|mp4|webm)))+$', 42 | // Other files with extensions. 43 | '^.+\\.(graphql|css|png|svg|jpe?g|webp|avif|wasm|mp4|webm)$', 44 | ], 45 | importOrderParserPlugins: ['typescript', 'jsx', 'decorators-legacy', 'importAssertions'], 46 | }; 47 | -------------------------------------------------------------------------------- /packages/prettier-config/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@theguild/prettier-config", 3 | "version": "3.0.1", 4 | "type": "module", 5 | "description": "The Guild's shared Prettier config", 6 | "repository": { 7 | "url": "the-guild-org/shared-config", 8 | "directory": "packages/prettier-config" 9 | }, 10 | "author": "The Guild (https://the-guild.dev)", 11 | "license": "MIT", 12 | "private": false, 13 | "exports": { 14 | ".": "./index.js", 15 | "./package.json": "./package.json" 16 | }, 17 | "keywords": [ 18 | "prettier", 19 | "prettier-config" 20 | ], 21 | "peerDependencies": { 22 | "prettier": "^3" 23 | }, 24 | "dependencies": { 25 | "@ianvs/prettier-plugin-sort-imports": "4.4.1", 26 | "prettier-plugin-pkg": "^0.18.0", 27 | "prettier-plugin-sh": "^0.15.0" 28 | }, 29 | "publishConfig": { 30 | "access": "public" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /packages/tailwind-config/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # @theguild/tailwind-config 2 | 3 | ## 0.6.3 4 | 5 | ### Patch Changes 6 | 7 | - 6f745e6: Add functional tones to Tailwind config 8 | 9 | ## 0.6.2 10 | 11 | ### Patch Changes 12 | 13 | - 4149fb5: Add theme.config.tsx back to Tailwind content 14 | 15 | ## 0.6.1 16 | 17 | ### Patch Changes 18 | 19 | - d23da18: Stop crashing when @theguild/components cannot be imported 20 | - 83a003f: add `'./content/**/*.{md,mdx}'` to Tailwind CSS config 21 | 22 | ## 0.6.0 23 | 24 | ### Minor Changes 25 | 26 | - 99b9452: Add `@tailwindcss/container-queries` plugin as `dependency` 27 | - ed086a8: Invert dark: prefix selector 28 | - a3d8e2f: - use ESM config for `postcss` 29 | - use `postcss-lightningcss` instead of `autoprefixer` and `cssnano` 30 | - BREAKING CHANGE: require `peerDependencies` to be installed `postcss-import`, 31 | `postcss-lightningcss` and `tailwindcss` 32 | - update tailwindcss `content` property to include Next.js' `app` directory 33 | - add `type: "module"` in `package.json` 34 | 35 | ### Patch Changes 36 | 37 | - a3d8e2f: dependencies updates: 38 | - Removed dependency 39 | [`autoprefixer@^10.4.19` ↗︎](https://www.npmjs.com/package/autoprefixer/v/10.4.19) (from 40 | `dependencies`) 41 | - Removed dependency [`cssnano@^7.0.0` ↗︎](https://www.npmjs.com/package/cssnano/v/7.0.0) (from 42 | `dependencies`) 43 | - Removed dependency [`postcss@^8.4.38` ↗︎](https://www.npmjs.com/package/postcss/v/8.4.38) (from 44 | `dependencies`) 45 | - Removed dependency 46 | [`postcss-import@^16.1.0` ↗︎](https://www.npmjs.com/package/postcss-import/v/16.1.0) (from 47 | `dependencies`) 48 | - Removed dependency [`tailwindcss@^3.4.3` ↗︎](https://www.npmjs.com/package/tailwindcss/v/3.4.3) 49 | (from `dependencies`) 50 | - Added dependency 51 | [`postcss-import@^16.1.0` ↗︎](https://www.npmjs.com/package/postcss-import/v/16.1.0) (to 52 | `peerDependencies`) 53 | - Added dependency 54 | [`postcss-lightningcss@^1.0.1` ↗︎](https://www.npmjs.com/package/postcss-lightningcss/v/1.0.1) 55 | (to `peerDependencies`) 56 | - Added dependency [`tailwindcss@^3.4.14` ↗︎](https://www.npmjs.com/package/tailwindcss/v/3.4.14) 57 | (to `peerDependencies`) 58 | 59 | ## 0.5.0 60 | 61 | ### Minor Changes 62 | 63 | - [#569](https://github.com/the-guild-org/shared-config/pull/569) 64 | [`f026ad1`](https://github.com/the-guild-org/shared-config/commit/f026ad16563ba57dcd746c095a49f81642a3e92a) 65 | Thanks [@hasparus](https://github.com/hasparus)! - Add Hive Design System colors 66 | 67 | ## 0.4.2 68 | 69 | ### Patch Changes 70 | 71 | - [#426](https://github.com/the-guild-org/shared-config/pull/426) 72 | [`eca3db9`](https://github.com/the-guild-org/shared-config/commit/eca3db99dfc0c675bbce58040d1036ca203bf5ef) 73 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 74 | - Updated dependency [`cssnano@^7.0.0` ↗︎](https://www.npmjs.com/package/cssnano/v/7.0.0) (from 75 | `^6.1.2`, in `dependencies`) 76 | 77 | ## 0.4.1 78 | 79 | ### Patch Changes 80 | 81 | - [#411](https://github.com/the-guild-org/shared-config/pull/411) 82 | [`534c7ba`](https://github.com/the-guild-org/shared-config/commit/534c7bad190eb4885c0cdb7a6b47c43277dc3a99) 83 | Thanks [@dimaMachina](https://github.com/dimaMachina)! - use `satisfies Config` for better typings 84 | 85 | ## 0.4.0 86 | 87 | ### Minor Changes 88 | 89 | - [#399](https://github.com/the-guild-org/shared-config/pull/399) 90 | [`30e2e64`](https://github.com/the-guild-org/shared-config/commit/30e2e64faf3730646740076919e2fb980adb89f7) 91 | Thanks [@dimaMachina](https://github.com/dimaMachina)! - export `tailwind.config` as esm, 92 | `postcss.config` as cjs 93 | 94 | ### Patch Changes 95 | 96 | - [#399](https://github.com/the-guild-org/shared-config/pull/399) 97 | [`30e2e64`](https://github.com/the-guild-org/shared-config/commit/30e2e64faf3730646740076919e2fb980adb89f7) 98 | Thanks [@dimaMachina](https://github.com/dimaMachina)! - dependencies updates: 99 | - Updated dependency 100 | [`autoprefixer@^10.4.19` ↗︎](https://www.npmjs.com/package/autoprefixer/v/10.4.19) (from 101 | `^10.4.16`, in `dependencies`) 102 | - Updated dependency [`cssnano@^6.1.2` ↗︎](https://www.npmjs.com/package/cssnano/v/6.1.2) (from 103 | `^6.0.2`, in `dependencies`) 104 | - Updated dependency [`postcss@^8.4.38` ↗︎](https://www.npmjs.com/package/postcss/v/8.4.38) (from 105 | `^8.4.32`, in `dependencies`) 106 | - Updated dependency 107 | [`postcss-import@^16.1.0` ↗︎](https://www.npmjs.com/package/postcss-import/v/16.1.0) (from 108 | `^16.0.0`, in `dependencies`) 109 | - Updated dependency [`tailwindcss@^3.4.3` ↗︎](https://www.npmjs.com/package/tailwindcss/v/3.4.3) 110 | (from `^3.3.6`, in `dependencies`) 111 | 112 | ## 0.3.2 113 | 114 | ### Patch Changes 115 | 116 | - [#325](https://github.com/the-guild-org/shared-config/pull/325) 117 | [`9820dae`](https://github.com/the-guild-org/shared-config/commit/9820dae5a5f32e8ae4d2a8ae407996ae8f826f63) 118 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 119 | - Updated dependency 120 | [`postcss-import@^16.0.0` ↗︎](https://www.npmjs.com/package/postcss-import/v/16.0.0) (from 121 | `^15.1.0`, in `dependencies`) 122 | 123 | ## 0.3.1 124 | 125 | ### Patch Changes 126 | 127 | - [#317](https://github.com/the-guild-org/shared-config/pull/317) 128 | [`d37d14e`](https://github.com/the-guild-org/shared-config/commit/d37d14eee9794d93b1b7129ed6244faa8b470056) 129 | Thanks [@dotansimha](https://github.com/dotansimha)! - dependencies updates: 130 | - Updated dependency 131 | [`autoprefixer@^10.4.16` ↗︎](https://www.npmjs.com/package/autoprefixer/v/10.4.16) (from 132 | `^10.4.14`, in `dependencies`) 133 | - Updated dependency [`cssnano@^6.0.2` ↗︎](https://www.npmjs.com/package/cssnano/v/6.0.2) (from 134 | `^6.0.1`, in `dependencies`) 135 | - Updated dependency [`postcss@^8.4.32` ↗︎](https://www.npmjs.com/package/postcss/v/8.4.32) (from 136 | `^8.4.25`, in `dependencies`) 137 | - Updated dependency [`tailwindcss@^3.3.6` ↗︎](https://www.npmjs.com/package/tailwindcss/v/3.3.6) 138 | (from `^3.3.2`, in `dependencies`) 139 | 140 | ## 0.3.0 141 | 142 | ### Minor Changes 143 | 144 | - [#255](https://github.com/the-guild-org/shared-config/pull/255) 145 | [`a68a857`](https://github.com/the-guild-org/shared-config/commit/a68a8579e65d6c67a4cf602956f32a9f305a9073) 146 | Thanks [@B2o5T](https://github.com/B2o5T)! - dependencies updates: 147 | - Updated dependency 148 | [`autoprefixer@^10.4.14` ↗︎](https://www.npmjs.com/package/autoprefixer/v/10.4.14) (from 149 | `^10.4.12`, in `dependencies`) 150 | - Updated dependency [`cssnano@^6.0.1` ↗︎](https://www.npmjs.com/package/cssnano/v/6.0.1) (from 151 | `^6.0.0`, in `dependencies`) 152 | - Updated dependency [`postcss@^8.4.25` ↗︎](https://www.npmjs.com/package/postcss/v/8.4.25) (from 153 | `^8.4.16`, in `dependencies`) 154 | - Updated dependency 155 | [`postcss-import@^15.1.0` ↗︎](https://www.npmjs.com/package/postcss-import/v/15.1.0) (from 156 | `^15.0.0`, in `dependencies`) 157 | - Updated dependency [`tailwindcss@^3.3.2` ↗︎](https://www.npmjs.com/package/tailwindcss/v/3.3.2) 158 | (from `^3.1.8`, in `dependencies`) 159 | 160 | ## 0.2.2 161 | 162 | ### Patch Changes 163 | 164 | - [#204](https://github.com/the-guild-org/shared-config/pull/204) 165 | [`369d2f3`](https://github.com/the-guild-org/shared-config/commit/369d2f390538a717df1a61a6d7b386afca90de69) 166 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 167 | - Updated dependency [`cssnano@^6.0.0` ↗︎](https://www.npmjs.com/package/cssnano/v/6.0.0) (from 168 | `^5.1.13`, in `dependencies`) 169 | 170 | ## 0.2.1 171 | 172 | ### Patch Changes 173 | 174 | - [#92](https://github.com/the-guild-org/shared-config/pull/92) 175 | [`ffb3d22`](https://github.com/the-guild-org/shared-config/commit/ffb3d222709549feee58e277a9523e84e72c9e52) 176 | Thanks [@B2o5T](https://github.com/B2o5T)! - update tailwind config to be compatible with nextra 177 | styles 178 | 179 | ## 0.2.0 180 | 181 | ### Minor Changes 182 | 183 | - [#84](https://github.com/the-guild-org/shared-config/pull/84) 184 | [`620a0f9`](https://github.com/the-guild-org/shared-config/commit/620a0f9ae8e9559b80269faea0a62a565f0fc327) 185 | Thanks [@B2o5T](https://github.com/B2o5T)! - remove unneeded tailwind `content` field patterns 186 | 187 | ## 0.1.3 188 | 189 | ### Patch Changes 190 | 191 | - [#73](https://github.com/the-guild-org/shared-config/pull/73) 192 | [`570f65a`](https://github.com/the-guild-org/shared-config/commit/570f65a26e22049abc1a5a27c7f3ccb5f39d8e7a) 193 | Thanks [@B2o5T](https://github.com/B2o5T)! - add `package.json` to `exports` field 194 | 195 | ## 0.1.2 196 | 197 | ### Patch Changes 198 | 199 | - [#69](https://github.com/the-guild-org/shared-config/pull/69) 200 | [`5d7e85b`](https://github.com/the-guild-org/shared-config/commit/5d7e85b11170b20dd658f3410f21628a6d516a10) 201 | Thanks [@B2o5T](https://github.com/B2o5T)! - adjust config for pnpm projects 202 | 203 | ## 0.1.1 204 | 205 | ### Patch Changes 206 | 207 | - [#61](https://github.com/the-guild-org/shared-config/pull/61) 208 | [`9a56292`](https://github.com/the-guild-org/shared-config/commit/9a56292605bb0b5042c04659eaf0a49bc52170f8) 209 | Thanks [@B2o5T](https://github.com/B2o5T)! - dependencies updates: 210 | 211 | - Updated dependency 212 | [`autoprefixer@^10.4.12` ↗︎](https://www.npmjs.com/package/autoprefixer/v/10.4.12) (from 213 | `^10.4.8`, in `dependencies`) 214 | 215 | - [#61](https://github.com/the-guild-org/shared-config/pull/61) 216 | [`9a56292`](https://github.com/the-guild-org/shared-config/commit/9a56292605bb0b5042c04659eaf0a49bc52170f8) 217 | Thanks [@B2o5T](https://github.com/B2o5T)! - update tailwind config to use components bundled by 218 | tsup 219 | 220 | ## 0.1.0 221 | 222 | ### Minor Changes 223 | 224 | - [#50](https://github.com/the-guild-org/shared-config/pull/50) 225 | [`3f642fd`](https://github.com/the-guild-org/shared-config/commit/3f642fd029f946fe3013066b6c1545507ffbeba5) 226 | Thanks [@B2o5T](https://github.com/B2o5T)! - update deps 227 | 228 | ### Patch Changes 229 | 230 | - [#48](https://github.com/the-guild-org/shared-config/pull/48) 231 | [`1af78b4`](https://github.com/the-guild-org/shared-config/commit/1af78b4f36f20bcaf197add39f5e63761fdf0851) 232 | Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: 233 | 234 | - Updated dependency 235 | [`postcss-import@^15.0.0` ↗︎](https://www.npmjs.com/package/postcss-import/v/null) (from 236 | `^14.1.0`, in `dependencies`) 237 | 238 | - [#50](https://github.com/the-guild-org/shared-config/pull/50) 239 | [`3f642fd`](https://github.com/the-guild-org/shared-config/commit/3f642fd029f946fe3013066b6c1545507ffbeba5) 240 | Thanks [@B2o5T](https://github.com/B2o5T)! - dependencies updates: 241 | 242 | - Updated dependency 243 | [`autoprefixer@^10.4.8` ↗︎](https://www.npmjs.com/package/autoprefixer/v/null) (from `^10.4.7`, 244 | in `dependencies`) 245 | - Updated dependency [`cssnano@^5.1.13` ↗︎](https://www.npmjs.com/package/cssnano/v/null) (from 246 | `^5.1.12`, in `dependencies`) 247 | - Updated dependency [`postcss@^8.4.16` ↗︎](https://www.npmjs.com/package/postcss/v/null) (from 248 | `^8.4.14`, in `dependencies`) 249 | - Updated dependency [`tailwindcss@^3.1.8` ↗︎](https://www.npmjs.com/package/tailwindcss/v/null) 250 | (from `^3.1.6`, in `dependencies`) 251 | 252 | ## 0.0.2 253 | 254 | ### Patch Changes 255 | 256 | - 2493fe0: fix(tailwind-config): use `index.mjs` instead `index.esm.js` in content field 257 | 258 | ## 0.0.1 259 | 260 | ### Patch Changes 261 | 262 | - c8cb760: feat: add `@theguild/tailwind-config` 263 | -------------------------------------------------------------------------------- /packages/tailwind-config/README.md: -------------------------------------------------------------------------------- 1 | # @theguild/tailwind-config 2 | -------------------------------------------------------------------------------- /packages/tailwind-config/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@theguild/tailwind-config", 3 | "version": "0.6.3", 4 | "type": "module", 5 | "description": "The Guild's shared Tailwind config", 6 | "repository": { 7 | "url": "the-guild-org/shared-config", 8 | "directory": "packages/tailwind-config" 9 | }, 10 | "author": "The Guild (https://the-guild.dev)", 11 | "license": "MIT", 12 | "private": false, 13 | "exports": { 14 | "./package.json": "./package.json", 15 | ".": { 16 | "types": "./dist/tailwind.config.d.ts", 17 | "import": "./dist/tailwind.config.js", 18 | "require": "./dist/tailwind.config.js" 19 | }, 20 | "./postcss.config": { 21 | "types": "./dist/postcss.config.d.ts", 22 | "import": "./dist/postcss.config.js", 23 | "require": "./dist/postcss.config.js" 24 | } 25 | }, 26 | "files": [ 27 | "dist", 28 | "README.md" 29 | ], 30 | "keywords": [ 31 | "tailwind", 32 | "tailwind-config" 33 | ], 34 | "scripts": { 35 | "build": "tsup", 36 | "prepublishOnly": "pnpm build" 37 | }, 38 | "peerDependencies": { 39 | "postcss-import": "^16.1.0", 40 | "postcss-lightningcss": "^1.0.1", 41 | "tailwindcss": "^3.4.14" 42 | }, 43 | "dependencies": { 44 | "@tailwindcss/container-queries": "^0.1.1" 45 | }, 46 | "devDependencies": { 47 | "tsup": "8.4.0" 48 | }, 49 | "publishConfig": { 50 | "access": "public" 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /packages/tailwind-config/src/hive-colors.ts: -------------------------------------------------------------------------------- 1 | const hiveYellow = '#E1FF00'; 2 | 3 | export const hiveColors = { 4 | primary: hiveYellow, 5 | 'hive-yellow': hiveYellow, 6 | blue: { 7 | 100: '#F4F5F5', 8 | 200: '#DCE3E4', 9 | 300: '#C1D3D7', 10 | 400: '#A4C4CB', 11 | 500: '#86B6C1', 12 | 600: '#68A8B6', 13 | 700: '#4F96A6', 14 | 800: '#437C89', 15 | 900: '#39616A', 16 | 1000: '#2E474C', 17 | }, 18 | green: { 19 | 100: '#ECF6F3', 20 | 200: '#CAE4DE', 21 | 300: '#A7D5CA', 22 | 400: '#8CBEB3', 23 | 500: '#6AAC9E', 24 | 600: '#55998D', 25 | 700: '#3B736A', 26 | 800: '#245850', 27 | 900: '#15433C', 28 | 1000: '#00342C', 29 | }, 30 | beige: { 31 | 100: '#F8F7F6', 32 | 200: '#F1EEE4', 33 | 300: '#E9E5DA', 34 | 400: '#DEDACF', 35 | 500: '#CFCABF', 36 | 600: '#B9B4A9', 37 | 700: '#A29E93', 38 | 800: '#86827A', 39 | 900: '#6D6A63', 40 | 1000: '#4D4B46', 41 | }, 42 | // primary color functional tones, e.g. for icons in tables 43 | // use bright for icons and dark for text on light backgrounds 44 | // use dark for icons and bright for text on dark backgrounds 45 | 'critical-bright': '#FD3325', 46 | 'critical-dark': '#F81202', 47 | 'warning-bright': '#FE8830', 48 | 'positive-bright': '#24D551', 49 | 'positive-dark': '#1BA13D', 50 | // subtle matching functional tones, e.g. for callouts 51 | 'warning-100': '#FBF8CB', 52 | 'warning-500': '#E7DE62', 53 | 'warning-800': '#7D7204', 54 | 'critical-100': '#FFF0E8', 55 | 'critical-500': '#FFC6BB', 56 | 'critical-800': '#932D47', 57 | 'info-100': '#E7F7FF', 58 | 'info-500': '#9FC9DC', 59 | 'info-800': '#205B75', 60 | 'positive-100': '#F3FBD7', 61 | 'positive-500': '#AFD563', 62 | 'positive-800': '#406B10', 63 | }; 64 | -------------------------------------------------------------------------------- /packages/tailwind-config/src/postcss.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/no-default-export */ 2 | export default { 3 | plugins: { 4 | 'postcss-import': {}, 5 | tailwindcss: {}, 6 | 'postcss-lightningcss': { browsers: '>= .25% and not dead' }, 7 | }, 8 | }; 9 | -------------------------------------------------------------------------------- /packages/tailwind-config/src/tailwind.config.ts: -------------------------------------------------------------------------------- 1 | import path from 'node:path'; 2 | import { type Config } from 'tailwindcss'; 3 | import tailwindContainerQueries from '@tailwindcss/container-queries'; 4 | import { hiveColors } from './hive-colors.js'; 5 | 6 | // eslint-disable-next-line @typescript-eslint/no-explicit-any -- tailwindcss types are incorrect 7 | const makePrimaryColor: any = 8 | (val: number) => 9 | ({ opacityValue }: { opacityValue?: string }): string => { 10 | const h = 'var(--nextra-primary-hue)'; 11 | const s = 'var(--nextra-primary-saturation)'; 12 | const _l = 'var(--nextra-primary-lightness)'; 13 | const l = val ? `calc(${_l} + ${val}%)` : _l; 14 | return 'hsl(' + h + s + l + (opacityValue ? ` / ${opacityValue}` : '') + ')'; 15 | }; 16 | 17 | function getComponentsPatterns() { 18 | try { 19 | /** 20 | * We explicitly do not use `import { createRequire } from 'node:module'` and 21 | * `const require = createRequire(import.meta.url)` because it works even without it. 22 | * E.g. storybook complains about cannot found `module` package 23 | */ 24 | const componentsPackageJson = require.resolve('@theguild/components/package.json', { 25 | /** 26 | * Paths to resolve module location from CWD. Without specifying, it picks incorrect 27 | * `@theguild/components`, also must be relative 28 | */ 29 | paths: [process.cwd()], 30 | }); 31 | 32 | return [ 33 | path.relative(process.cwd(), path.posix.join(componentsPackageJson, '..', 'dist/**/*.js')), 34 | ]; 35 | } catch { 36 | console.warn("Can't find `@theguild/components` package."); 37 | return []; 38 | } 39 | } 40 | 41 | const config = { 42 | /** 43 | * Same as `class`, but with the ability to have light-only sections in dark mode. 44 | * @see https://github.com/tailwindlabs/tailwindcss/pull/12717/files#diff-cf9185e083748e39c6940d3ad337df23b0ecbbd70b9550f596de7cf4b4668bcfR263-R273 45 | */ 46 | darkMode: ['variant', '&:not(.light *)'], 47 | content: [ 48 | './{src,app}/**/*.{tsx,mdx}', 49 | './mdx-components.tsx', 50 | './content/**/*.{md,mdx}', 51 | './theme.config.tsx', // Still needed for Nextra 3 websites. 52 | ...getComponentsPatterns(), 53 | ], 54 | theme: { 55 | container: { 56 | center: true, 57 | padding: { 58 | DEFAULT: '1rem', 59 | sm: '2rem', 60 | lg: '4rem', 61 | xl: '5rem', 62 | '2xl': '6rem', 63 | }, 64 | }, 65 | screens: { 66 | sm: '640px', 67 | md: '768px', 68 | lg: '1024px', 69 | xl: '1280px', 70 | '2xl': '1536px', 71 | }, 72 | fontSize: { 73 | xs: '.75rem', 74 | sm: '.875rem', 75 | base: '1rem', 76 | lg: '1.125rem', 77 | xl: '1.25rem', 78 | '2xl': '1.5rem', 79 | '3xl': '1.875rem', 80 | '4xl': '2.25rem', 81 | '5xl': '3rem', 82 | '6xl': '4rem', 83 | }, 84 | letterSpacing: { 85 | tight: '-0.015em', 86 | }, 87 | extend: { 88 | colors: { 89 | ...hiveColors, 90 | dark: '#111', 91 | primary: { 92 | 50: makePrimaryColor(52), 93 | 100: makePrimaryColor(49), 94 | 200: makePrimaryColor(41), 95 | 300: makePrimaryColor(32), 96 | 400: makePrimaryColor(21), 97 | 500: makePrimaryColor(5), 98 | 600: makePrimaryColor(0), 99 | 700: makePrimaryColor(-6), 100 | 750: makePrimaryColor(-10), 101 | 800: makePrimaryColor(-13), 102 | 900: makePrimaryColor(-21), 103 | 1000: makePrimaryColor(-33), 104 | }, 105 | }, 106 | }, 107 | }, 108 | plugins: [tailwindContainerQueries], 109 | } satisfies Config; 110 | 111 | export default config; 112 | export { type Config }; 113 | -------------------------------------------------------------------------------- /packages/tailwind-config/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "module": "NodeNext", 5 | "strict": true, 6 | "esModuleInterop": true, 7 | "skipLibCheck": true, 8 | "moduleResolution": "NodeNext", 9 | "forceConsistentCasingInFileNames": true 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /packages/tailwind-config/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'tsup'; 2 | 3 | export default defineConfig({ 4 | name: 'tailwind.config', 5 | entry: ['src'], 6 | format: 'esm', 7 | dts: true, 8 | clean: true, 9 | bundle: false, 10 | plugins: [ 11 | { 12 | // Strip `node:` prefix from imports because Storybook complains about it 13 | name: 'strip-node-colon', 14 | renderChunk(code) { 15 | // (?<= from ") 16 | // Positive lookbehind asserts that the pattern we're trying to match is preceded by 17 | // ` from "`, but does not include ` from "` in the actual match. 18 | // 19 | // (?=";) 20 | // Positive lookahead asserts that the pattern is followed by `";`, but does not include 21 | // `";` in the match. 22 | const replaced = code.replaceAll(/(?<= from ")node:(.+)(?=";)/g, '$1'); 23 | return { code: replaced }; 24 | }, 25 | }, 26 | ], 27 | }); 28 | -------------------------------------------------------------------------------- /patches/eslint-remote-tester@3.0.1.patch: -------------------------------------------------------------------------------- 1 | diff --git a/dist/engine/worker-task.js b/dist/engine/worker-task.js 2 | index 1f251f8..b360215 100644 3 | --- a/dist/engine/worker-task.js 4 | +++ b/dist/engine/worker-task.js 5 | @@ -55,7 +55,7 @@ function getMessageReducer(repository) { 6 | return _config_1.default.rulesUnderTesting.includes(message.ruleId); 7 | } 8 | return function reducer(all, result) { 9 | - const messages = result.messages.filter(messageFilter); 10 | + const { messages } = result // Don't filter rules by ruleId, show all 11 | // Process only rules that are under testing 12 | if (messages.length === 0) { 13 | return all; 14 | diff --git a/dist/file-client/results-writer.js b/dist/file-client/results-writer.js 15 | index adb37a3..314f909 100644 16 | --- a/dist/file-client/results-writer.js 17 | +++ b/dist/file-client/results-writer.js 18 | @@ -68,7 +68,7 @@ async function writeResults(messages, repository) { 19 | if (!_config_1.default.CI) { 20 | // Construct result file name, e.g. mui-org_material-ui.md 21 | const repositoryOwnerAndName = repository.split('/').join('_'); 22 | - const fileName = `${repositoryOwnerAndName}${RESULT_EXTENSION}`; 23 | + const fileName = `${messages.length}-${repositoryOwnerAndName}${RESULT_EXTENSION}` // Add prefix with total errors 24 | await new Promise((resolve, reject) => { 25 | const stream = fs_1.default 26 | .createWriteStream(`${file_constants_1.RESULTS_LOCATION}/${fileName}`, { 27 | -------------------------------------------------------------------------------- /pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | packages: 2 | - packages/* 3 | -------------------------------------------------------------------------------- /prettier.config.js: -------------------------------------------------------------------------------- 1 | export { default } from '@theguild/prettier-config'; 2 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": ["config:base", "helpers:pinGitHubActionDigests"], 4 | "postUpdateOptions": ["yarnDedupeFewer"], 5 | "automerge": false, 6 | "lockFileMaintenance": { 7 | "enabled": true, 8 | "automerge": true 9 | }, 10 | "github-actions": { 11 | "fileMatch": [ 12 | "(^|/)(workflow-templates|\\.(?:github|gitea|forgejo)/(?:workflows|actions))/.+\\.ya?ml$", 13 | "(^|/)action\\.ya?ml$", 14 | "(^|/)setup/action\\.ya?ml", 15 | "(^|/)website-cf/action\\.ya?ml" 16 | ] 17 | }, 18 | "recreateClosed": false, 19 | "prConcurrentLimit": 25, 20 | "labels": ["dependencies"], 21 | "rebaseWhen": "conflicted", 22 | "packageRules": [ 23 | { 24 | "groupName": "graphql-eslint", 25 | "matchPackagePrefixes": ["@graphql-eslint"], 26 | "prPriority": 20, 27 | "reviewers": ["dotansimha"] 28 | }, 29 | { 30 | "groupName": "bob-the-bundler", 31 | "matchPackagePrefixes": ["bob-the-bundler"], 32 | "prPriority": 20, 33 | "reviewers": ["n1ru4l"] 34 | }, 35 | { 36 | "groupName": "graphql-tools", 37 | "matchPackagePrefixes": ["@graphql-tools"], 38 | "prPriority": 20, 39 | "reviewers": ["ardatan"] 40 | }, 41 | { 42 | "groupName": "SOFA", 43 | "matchPackagePrefixes": ["sofa-api"], 44 | "prPriority": 20, 45 | "reviewers": ["ardatan"] 46 | }, 47 | { 48 | "groupName": "graphql-modules", 49 | "matchPackagePrefixes": ["graphql-modules"], 50 | "prPriority": 20, 51 | "reviewers": ["kamilkisiela"] 52 | }, 53 | { 54 | "groupName": "graphql-mesh", 55 | "matchPackagePrefixes": ["@graphql-mesh"], 56 | "prPriority": 20, 57 | "reviewers": ["ardatan", "gilgardosh", "enisdenjo", "EmrysMyrddin"] 58 | }, 59 | { 60 | "groupName": "graphql-codegen", 61 | "matchPackagePrefixes": ["@graphql-codegen"], 62 | "prPriority": 20, 63 | "reviewers": ["dotansimha", "eddeee888"] 64 | }, 65 | { 66 | "groupName": "envelop", 67 | "matchPackagePrefixes": ["@envelop"], 68 | "prPriority": 20, 69 | "reviewers": ["n1ru4l", "EmrysMyrddin"] 70 | }, 71 | { 72 | "groupName": "graphql-inspector", 73 | "matchPackagePrefixes": ["@graphql-inspector"], 74 | "prPriority": 20, 75 | "reviewers": ["TuvalSimha", "kamilkisiela"] 76 | }, 77 | { 78 | "groupName": "graphql-yoga", 79 | "matchPackagePrefixes": ["@graphql-yoga", "graphql-yoga"], 80 | "prPriority": 20, 81 | "reviewers": ["ardatan", "enisdenjo", "n1ru4l", "EmrysMyrddin"] 82 | }, 83 | { 84 | "groupName": "whatwg-node", 85 | "matchPackagePrefixes": ["@whatwg-node"], 86 | "prPriority": 20, 87 | "reviewers": ["ardatan", "EmrysMyrddin"] 88 | }, 89 | { 90 | "groupName": "graphql-scalars", 91 | "matchPackagePrefixes": ["graphql-scalars"], 92 | "prPriority": 20, 93 | "reviewers": ["ardatan"] 94 | }, 95 | { 96 | "groupName": "@theguild/components + nextra", 97 | "matchPackageNames": [ 98 | "@theguild/components", 99 | "@theguild/tailwind-config", 100 | "nextra", 101 | "nextra-theme-docs", 102 | "nextra-theme-blog" 103 | ], 104 | "prPriority": 20 105 | }, 106 | { 107 | "groupName": "prettier", 108 | "matchPackageNames": ["prettier", "@theguild/prettier-config"], 109 | "prPriority": 20 110 | }, 111 | { 112 | "matchDepTypes": ["devDependencies"], 113 | "prPriority": 19 114 | } 115 | ], 116 | "ignorePaths": ["**/__tests__/**", "**/test/**", "**/tests/**", "**/__fixtures__/**"] 117 | } 118 | -------------------------------------------------------------------------------- /setup/action.yml: -------------------------------------------------------------------------------- 1 | # Note: This is a composite GitHub Actions, it should do all env setup, caching an so on, so other pipelines can just compose their own stuff on top of that. 2 | # Docs: https://docs.github.com/en/actions/creating-actions/creating-a-composite-action 3 | 4 | name: Configure Environment 5 | description: Shared configuration for checkout, Node.js and package manager 6 | inputs: 7 | nodeVersion: 8 | description: Node.js version to use 9 | required: true 10 | default: '22' 11 | workingDirectory: 12 | description: Working directory 13 | required: false 14 | default: ./ 15 | packageManager: 16 | description: Package manager 17 | required: false 18 | default: yarn 19 | packageManagerVersion: 20 | description: Package manager version 21 | required: false 22 | default: '' 23 | 24 | runs: 25 | using: composite 26 | steps: 27 | - name: Cancel Previous Runs 28 | uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1 29 | continue-on-error: true 30 | with: 31 | access_token: ${{ github.token }} 32 | 33 | - name: check pnpm version 34 | shell: bash 35 | id: pnpm 36 | if: inputs.packageManager == 'pnpm' 37 | working-directory: ${{ inputs.workingDirectory }} 38 | run: | 39 | PNPM_VERSION=${PNPM_VERSION:-10.6.4} 40 | PKG_JSON=$(cat package.json | jq -r '.packageManager' | awk -F@ '{print $2}') 41 | if [ ! -z $PKG_JSON ]; then 42 | PNPM_VERSION=$PKG_JSON 43 | fi 44 | if [ ! -z {{inputs.packageManager}} ]; then 45 | PNPM_VERSION=${{ inputs.packageManagerVersion }} 46 | fi 47 | echo "Using PNPM version $PNPM_VERSION" 48 | echo "version=$PNPM_VERSION" >> $GITHUB_OUTPUT 49 | 50 | - name: Setup ${{ inputs.packageManager }} 51 | id: pnpm_setup 52 | if: inputs.packageManager == 'pnpm' 53 | uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 54 | with: 55 | version: ${{ steps.pnpm.outputs.version }} 56 | run_install: false 57 | package_json_file: ${{ inputs.workingDirectory }}/package.json 58 | 59 | - name: setup node 60 | uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0 61 | with: 62 | node-version: ${{ inputs.nodeVersion }} 63 | cache: ${{ inputs.packageManager }} 64 | cache-dependency-path: | 65 | **/pnpm-lock.yaml 66 | **/yarn.lock 67 | patches/** 68 | 69 | - name: yarn install 70 | shell: bash 71 | if: inputs.packageManager == 'yarn' && inputs.packageManagerVersion == '' 72 | run: yarn install --ignore-engines --frozen-lockfile --immutable 73 | working-directory: ${{ inputs.workingDirectory }} 74 | 75 | - name: modern yarn install 76 | shell: bash 77 | if: inputs.packageManager == 'yarn' && inputs.packageManagerVersion == 'modern' 78 | run: corepack enable && yarn 79 | working-directory: ${{ inputs.workingDirectory }} 80 | 81 | - name: pnpm install 82 | shell: bash 83 | if: inputs.packageManager == 'pnpm' 84 | run: pnpm install --frozen-lockfile 85 | working-directory: ${{ inputs.workingDirectory }} 86 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */, 4 | "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, 5 | "strict": true /* Enable all strict type-checking options. */, 6 | "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, 7 | "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /website-cf/action.yml: -------------------------------------------------------------------------------- 1 | # Note: This is a composite GitHub Actions, it should do all env setup, caching an so on, so other pipelines can just compose their own stuff on top of that. 2 | # Docs: https://docs.github.com/en/actions/creating-actions/creating-a-composite-action 3 | 4 | name: Deploy Website to CF 5 | description: Shared configuration for deploying website to Cloudflare Pages 6 | inputs: 7 | websiteDirectory: 8 | description: Build script for building the website 9 | required: false 10 | default: website 11 | buildScript: 12 | description: Build script for building the website 13 | required: true 14 | cloudflareApiToken: 15 | description: CF API Token 16 | required: true 17 | cloudflareAccountId: 18 | description: CF API Account ID 19 | required: true 20 | githubToken: 21 | description: GH PAT 22 | required: true 23 | projectName: 24 | description: CF Pages Project name 25 | required: true 26 | artifactDir: 27 | description: Artifact dir after build and export 28 | required: false 29 | default: out 30 | prId: 31 | description: PR id for publishing preview 32 | required: false 33 | default: '' 34 | commentId: 35 | description: ID to use for the comment 36 | required: false 37 | default: website_deployment 38 | commentTitle: 39 | description: Title to use for the PR comment 40 | required: false 41 | default: 💻 Website Preview 42 | mainBranch: 43 | description: The main branch name that is set in CF Pages 44 | required: false 45 | default: '' 46 | 47 | runs: 48 | using: composite 49 | steps: 50 | - name: build website 51 | shell: bash 52 | run: ${{ inputs.buildScript }} 53 | working-directory: ${{ inputs.websiteDirectory }} 54 | 55 | - name: fix wildcard redirects 56 | shell: bash 57 | # NextJS requires "docs/things/:path*" syntax, but that does not work on Cloudflare. 58 | # Redirects in CF uses "*" and ":splat". 59 | # With ":path*" the redirect from "docs/old/:path*" to "docs/new/:path*" becomes "docs/new/foo*" 60 | # - /docs/integrations/:path* /docs/other-integrations/:path* 302 61 | # + /docs/integrations/* /docs/other-integrations/:splat 302 62 | run: | 63 | if [ -f _redirects ]; then 64 | sed -i 's|\([^ ]*\):path\* \([^ ]*\):path\* \([0-9]*\)|\1* \2:splat \3|' _redirects 65 | fi 66 | working-directory: ${{ format('{0}/{1}', inputs.websiteDirectory, inputs.artifactDir) }} 67 | 68 | - name: push to cloudflare pages 69 | uses: cloudflare/wrangler-action@da0e0dfe58b7a431659754fdf3f186c529afbe65 # v3.14.1 70 | id: deploy 71 | with: 72 | apiToken: ${{ inputs.cloudflareApiToken }} 73 | accountId: ${{ inputs.cloudflareAccountId }} 74 | command: | 75 | pages deploy ${{ format('{0}/{1}', inputs.websiteDirectory, inputs.artifactDir) }} --project-name=${{ inputs.projectName }} --branch=${{ inputs.prId != '' && format('pr-{0}', inputs.prId) || inputs.mainBranch }} 76 | gitHubToken: ${{ inputs.githubToken }} 77 | 78 | - name: find pr comment 79 | uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e # v3.1.0 80 | id: fc 81 | if: ${{ inputs.prId != '' }} 82 | with: 83 | token: ${{ inputs.githubToken }} 84 | issue-number: ${{ inputs.prId }} 85 | comment-author: 'github-actions[bot]' 86 | body-includes: 87 | 88 | - name: create/update comment 89 | uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0 90 | if: ${{ inputs.prId != '' }} 91 | with: 92 | token: ${{ inputs.githubToken }} 93 | comment-id: ${{ steps.fc.outputs.comment-id }} 94 | issue-number: ${{ inputs.prId }} 95 | body: | 96 | 97 | ### ${{ inputs.commentTitle }} 98 | 99 | The latest changes are available as preview in: [${{ steps.deploy.outputs.pages-deployment-alias-url }}](${{ steps.deploy.outputs.pages-deployment-alias-url }}) 100 | edit-mode: replace 101 | --------------------------------------------------------------------------------