Disable default export rules
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
Showing
... | @@ -160,7 +160,7 @@ | ... | @@ -160,7 +160,7 @@ |
}, | }, | ||
"devDependencies": { | "devDependencies": { | ||
"@babel/plugin-transform-modules-commonjs": "^7.10.1", | "@babel/plugin-transform-modules-commonjs": "^7.10.1", | ||
"@gitlab/eslint-plugin": "3.2.0", | "@gitlab/eslint-plugin": "4.0.0", | ||
"@testing-library/dom": "^7.16.2", | "@testing-library/dom": "^7.16.2", | ||
"@vue/test-utils": "1.0.0-beta.30", | "@vue/test-utils": "1.0.0-beta.30", | ||
"acorn": "^6.3.0", | "acorn": "^6.3.0", | ||
... | ... |
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Please register or sign in to comment