Skip to content
Snippets Groups Projects
Select Git revision
  • master default protected
  • docs/mj/architecture-overview
  • ab/dont-assume-public
  • 225175-change-the-default-order-for-packages-in-the-package-registry-list-view-to-default-to
  • ph/224141/hideBatchSuggestionsWithOnlyOneSuggestion
  • fj-snippets-blob-resolver
  • 250998-fix-missing-vsa-request-parameters
  • 223812-add-mutation-to-confirm-vulnerability
  • release-tools/update-gitaly
  • 251013-on-design-discussion-note-icons-are-misaligned
  • canary-ingress-rails
  • 239472-swimlanes-license
  • 250269-disable-batch-count-because-pipelines-that-have-security-jobs-counters-fail-on-gitlab-com
  • 223812-add-mutation-to-resolve-vulnerability
  • 212322-ignore-uuid-on-vulnerabilities-occurences
  • 219565-increase-limit-for-number-of-files-loaded-for-a-single-diff-be
  • 235387-allow-for-project-releases-to-be-associated-with-group-milestones-in-the-database
  • 4745-search-add-epics-scope
  • add-review-request-to-to-do-list-filter
  • extend_documentation_links_validation
  • v13.3.6-ee
  • v13.2.9-ee
  • v13.1.11-ee
  • v13.3.5-ee
  • v13.1.10-ee
  • v13.2.8-ee
  • v13.3.4-ee
  • v13.1.9-ee
  • v13.2.7-ee
  • v13.3.3-ee
  • v13.3.2-ee
  • v13.3.1-ee
  • v13.3.0-ee
  • v13.3.0-rc44-ee
  • v13.3.0-rc43-ee
  • v13.3.0-rc42-ee
  • v13.0.14-ee
  • v13.1.8-ee
  • v13.2.6-ee
  • v13.0.13-ee
40 results

getters.js

Forked from GitLab.org / GitLab
Source project has a limited visibility.
  • markrian's avatar
    600155b6
    Disable default export rules · 600155b6
    markrian authored
    This is part of the work to implement the consensus reached in the
    [RFC][1] to prefer named exports over defalt exports.
    
    Future iterations will migrate existing default exports to named
    exports.
    
    The bulk of the changes in this commit were performed with the following
    script:
    
    ```bash
    set -u
    
    changed-files()
    {
        local trunk="origin/master"
        local file=
        local committed_files=$(git diff "$trunk"... --numstat \
            | awk '/\.(js|vue)$/{ print $3 }')
        local changed_files=$(git diff --numstat \
            | awk '/\.(js|vue)$/{ print $3 }')
        for file in ${committed_files[@]} ${changed_files[@]}; do
            if [ -f "$file" ]; then
                echo "$file"
            fi
        done
    }
    
    git grep -lz "import/prefer-default-export" -- '**/*.js' \
        | xargs -0 perl -0pi -e \
        "s/[^\n]*eslint-disable[^\n]*"\
    "import\/prefer-default-export[^\n]*\n//mgs"
    
    git grep -lz "rfcs/-/issues/20" -- '**/*.js' \
        | xargs -0 perl -0pi -e \
        "s/[^\n]*rfcs\/-\/issues\/20[^\n]*\n//mgs"
    
    yarn prettier --write $(changed-files)
    ```
    
    The script is [idempotent][2], to help make it easier to keep
    up-to-date.
    
    [1]: https://gitlab.com/gitlab-org/frontend/rfcs/-/issues/20
    [2]: https://en.wikipedia.org/wiki/Idempotence
    Disable default export rules
    markrian authored
    This is part of the work to implement the consensus reached in the
    [RFC][1] to prefer named exports over defalt exports.
    
    Future iterations will migrate existing default exports to named
    exports.
    
    The bulk of the changes in this commit were performed with the following
    script:
    
    ```bash
    set -u
    
    changed-files()
    {
        local trunk="origin/master"
        local file=
        local committed_files=$(git diff "$trunk"... --numstat \
            | awk '/\.(js|vue)$/{ print $3 }')
        local changed_files=$(git diff --numstat \
            | awk '/\.(js|vue)$/{ print $3 }')
        for file in ${committed_files[@]} ${changed_files[@]}; do
            if [ -f "$file" ]; then
                echo "$file"
            fi
        done
    }
    
    git grep -lz "import/prefer-default-export" -- '**/*.js' \
        | xargs -0 perl -0pi -e \
        "s/[^\n]*eslint-disable[^\n]*"\
    "import\/prefer-default-export[^\n]*\n//mgs"
    
    git grep -lz "rfcs/-/issues/20" -- '**/*.js' \
        | xargs -0 perl -0pi -e \
        "s/[^\n]*rfcs\/-\/issues\/20[^\n]*\n//mgs"
    
    yarn prettier --write $(changed-files)
    ```
    
    The script is [idempotent][2], to help make it easier to keep
    up-to-date.
    
    [1]: https://gitlab.com/gitlab-org/frontend/rfcs/-/issues/20
    [2]: https://en.wikipedia.org/wiki/Idempotence