Skip to content

Commit

Permalink
Experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
QubitPi committed Nov 23, 2023
1 parent 5600237 commit 13eca98
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
33 changes: 33 additions & 0 deletions add-ts-nocheck.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
const fs = require('fs')

const ADDED_STR = '// @ts-nocheck\n\n'
const FILES = [
'node_modules/i18next/index.v4.d.ts',
'node_modules/react-i18next/index.d.ts'
]

Promise.allSettled(FILES.map(addTsNoCheck)).then(results => {
let hasErrors = false

for (const result of results) {
if (result.status === 'rejected') {
hasErrors = true
console.error(result.reason)
}
}

if (hasErrors) {
process.exit(1)
}
})

async function addTsNoCheck(file) {
const content = fs.readFileSync(file).toString()

if (content.includes(ADDED_STR)) {
console.log(JSON.stringify(ADDED_STR), 'is already in', file)
} else {
fs.writeFileSync(file, ADDED_STR + content)
console.log(JSON.stringify(ADDED_STR), 'added into', file)
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"starts": "cross-env NODE_ENV=development webpack-dev-server --https --colors --config ./build_scripts/webpack.config.js",
"start-prod": "cross-env NODE_ENV=production webpack-dev-server --colors --config ./build_scripts/webpack.config.js",
"starts-prod": "cross-env NODE_ENV=production webpack-dev-server --https --colors --config ./build_scripts/webpack.config.js",
"test": "tsc --noEmit && yarn lint-quiet && yarn jest",
"test": "node add-ts-nocheck && tsc --noEmit && yarn lint-quiet && yarn jest",
"test-e2e": "npx concurrently --kill-others -n 'neo4j,cypress,browser' 'docker run --env NEO4J_AUTH=neo4j/newpassword -p7474:7474 -p7687:7687 neo4j:4.2.2' 'yarn wait-on-neo4j && yarn wait-on-dev && yarn e2e-local --env server=4.2' 'yarn && yarn start'",
"update-licenses": "sh ./scripts/generate_licenses.sh",
"version-pom": "node ./scripts/set-pom-version.js -f ./pom.xml -v $npm_package_version",
Expand Down

0 comments on commit 13eca98

Please sign in to comment.