Files
Huáng JùnliàngandGitHub f8270721e3 fix(parser): forbid let x! and let x! = (#18100)
* fix(parser): forbid `let x!` and `let x! =`

* test: expand test cases to other variable kinds

* refactor: address review comment

* fix(parser): forbid `x!` and `x! =` as class properties

* update test cases

* remove failing prettier tests

* add new test case
2026-07-06 10:57:51 -04:00

70 lines
2.7 KiB
Bash
Executable File

#!/usr/bin/env bash
#==============================================================================#
# SETUP #
#==============================================================================#
# Start in scripts/integration-tests/ even if run from root directory
cd "$(dirname "$0")" || exit
root="$PWD"
source utils/local-registry.sh
source utils/cleanup.sh
# Echo every command being executed
set -x
# Clone prettier
git clone --depth=1 https://github.com/prettier/prettier /tmp/prettier
cd /tmp/prettier || exit
# Update @babel/* dependencies
node "$root/utils/bump-babel-dependencies.js"
#==============================================================================#
# ENVIRONMENT #
#==============================================================================#
node -v
yarn --version
#==============================================================================#
# TEST #
#==============================================================================#
startLocalRegistry "$root"/verdaccio-config.yml
yarn install --no-immutable
yarn info
# Babel 8 related adjustments
sed -i "s/ts-expect-error//g" ./src/language-json/parse/json.js
sed -i 's/"TupleExpression",//g' src/language-js/traverse/visitor-keys.evaluate.js
sed -i 's/"RecordExpression",//g' src/language-js/traverse/visitor-keys.evaluate.js
sed -i 's#TSImportType:#//#g' src/language-js/traverse/visitor-keys.evaluate.js
sed -i 's#ExportAllDeclaration:#//#g' src/language-js/traverse/visitor-keys.evaluate.js
sed -i 's#ImportDeclaration:#//#g' src/language-js/traverse/visitor-keys.evaluate.js
sed -i 's#TSDeclareMethod:#//#g' src/language-js/traverse/visitor-keys.evaluate.js
sed -i 's/const allowedReasonCodesArray = \[/const allowedReasonCodesArray = ["DecoratorAbstractMethod",/g' src/language-js/parse/babel.js
rm tests/format/js/import-assertions/format.test.js
rm tests/format/js/import-assertions/bracket-spacing/format.test.js
rm tests/format/typescript/conformance/classes/constructorDeclarations/constructorParameters/constructorOverloadsWithDefaultValues.ts
# https://github.com/babel/babel/pull/18100
rm -r tests/format/typescript/definite
# Test typings for @babel/parser
yarn lint:typecheck
# https://github.com/babel/babel/pull/14892#issuecomment-1233180626
echo "export default () => () => {}" > src/main/create-print-pre-check-function.js
# https://github.com/babel/babel/pull/15400#issuecomment-1414539133
# Temporarily ignore tests, use `rm -f path/to/format.test.js`
# rm -f path/to/format.test.js
yarn test "tests/format/(jsx?|misc|typescript|flow|flow-repo)/" --update-snapshot
cleanup