Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript: Add initial infrastructure #10783

Merged
merged 6 commits into from
Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,7 @@ README.md
rollup.config.js
scoper.inc.php
SECURITY.md
tsconfig.json
tsconfig.shared.json
webpack.config.cjs
webpack.config.test.cjs
32 changes: 31 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@
"^@googleforcreators\\/(.*)\\/(.*)": "./packages/$1/src/$2",
"^@googleforcreators\\/(.*)": "./packages/$1/src/",
"^@web-stories-wp\\/(.*)": "./packages/$1/src/"
}
},
"extensions": [ ".js", ".jsx", ".ts", ".tsx" ]
}
},
"jsdoc": {
Expand Down Expand Up @@ -284,6 +285,32 @@
]
},
"overrides": [
{
"files": [
"**/*.ts",
"**/*.tsx"
],
"excludedFiles": [
"**/*.d.ts"
],
"plugins": [
"@typescript-eslint"
],
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/eslint-recommended"
],
"parser": "@typescript-eslint/parser",
"rules": {
"no-duplicate-imports": "off",
"@typescript-eslint/no-duplicate-imports": "error",
"jsdoc/require-param-type": "off",
"jsdoc/require-returns-type": "off",
"no-unused-vars": "off",
"no-shadow": "off",
"@typescript-eslint/no-shadow": "error"
}
},
{
"files": [
"__mocks__/**/*.js",
Expand Down Expand Up @@ -315,6 +342,7 @@
"eslint-comments/require-description": "off",
"react/prop-types": "off",
"jest/no-hooks": "off",
"jest/max-expects": "off",
"jest/prefer-expect-assertions": "off",
"jest/prefer-inline-snapshots": "off",
"jest/prefer-lowercase-title": [
Expand Down Expand Up @@ -415,6 +443,7 @@
},
"rules": {
"eslint-comments/require-description": "off",
"jest/max-expects": "off",
"jest/no-hooks": "off",
"jest/prefer-expect-assertions": "off",
"jest/prefer-inline-snapshots": "off",
Expand Down Expand Up @@ -452,6 +481,7 @@
"rules": {
"eslint-comments/require-description": "off",
"jest/expect-expect": "off",
"jest/max-expects": "off",
"jest/no-export": "off",
"jest/require-top-level-describe": "off"
}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
paths:
- '**.js'
- '**.cjs'
- '**.ts'
branches:
- main
- release/*
Expand All @@ -14,6 +15,7 @@ on:
paths:
- '**.js'
- '**.cjs'
- '**.ts'
# The branches below must be a subset of the branches above
branches:
- main
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/lint-css-js-md.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
paths:
- '**.js'
- '**.cjs'
- '**.ts'
- '**.css'
- 'docs/**/*.md'
- 'packages/**/*.md'
Expand All @@ -25,6 +26,7 @@ on:
paths:
- '**.js'
- '**.cjs'
- '**.ts'
- '**.css'
- 'docs/**/*.md'
- 'packages/**/*.md'
Expand Down Expand Up @@ -108,3 +110,6 @@ jobs:
if: >
github.event.pull_request.head.repo.fork == false &&
github.event.pull_request.user.login != 'dependabot[bot]'

- name: Type checking
run: npm run workflow:bundle-packages:types
4 changes: 4 additions & 0 deletions .github/workflows/lint-i18n.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
paths:
- '**.js'
- '**.cjs'
- '**.ts'
- '**/package.json'
- 'package-lock.json'
- 'web-stories.php'
Expand All @@ -14,6 +16,8 @@ on:
pull_request:
paths:
- '**.js'
- '**.cjs'
- '**.ts'
- '**/package.json'
- 'package-lock.json'
- 'web-stories.php'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tests-karma-dashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- 'webpack.config.cjs'
- 'webpack.config.test.cjs'
- 'packages/**/*.js'
- 'packages/**/*.ts'
- '**/package.json'
- 'package-lock.json'
- '__static__/**'
Expand All @@ -23,6 +24,7 @@ on:
- 'webpack.config.cjs'
- 'webpack.config.test.cjs'
- 'packages/**/*.js'
- 'packages/**/*.ts'
- '**/package.json'
- 'package-lock.json'
- '__static__/**'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tests-karma-editor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- 'webpack.config.test.cjs'
- 'packages/**/*.js'
- 'packages/**/*.cjs'
- 'packages/**/*.ts'
- '**/package.json'
- 'package-lock.json'
- '__static__/**'
Expand All @@ -26,6 +27,7 @@ on:
- 'webpack.config.test.cjs'
- 'packages/**/*.js'
- 'packages/**/*.cjs'
- 'packages/**/*.ts'
- '**/package.json'
- 'package-lock.json'
- '__static__/**'
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/tests-unit-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
# Only run if JS-related files changed.
paths:
- '**.js'
- '**.cjs'
- '**.ts'
- '**/package.json'
- 'package-lock.json'
- 'packages/templates/src/raw/**'
Expand All @@ -18,6 +20,8 @@ on:
# Only run if JS-related files changed.
paths:
- '**.js'
- '**.cjs'
- '**.ts'
- '**/package.json'
- 'package-lock.json'
- 'packages/templates/src/raw/**'
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ node_modules
/packages/migration/scripts/module.js
/packages/*/dist
/packages/*/dist-module
/packages/*/dist-types
/build
/bin/build
/bin/local-env/data
Expand All @@ -22,3 +23,4 @@ phpcs.xml
phpunit.xml
.phpunit.result.cache
/packages/*/package-lock.json
tsconfig.tsbuildinfo
1 change: 1 addition & 0 deletions .npmpackagejsonlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"exports",
"main",
"module",
"types",
"source",
"publishConfig",
"sideEffects",
Expand Down
1 change: 1 addition & 0 deletions babel.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ module.exports = function (api) {
development: !isProduction,
},
],
'@babel/preset-typescript',
],
plugins: [
'@wordpress/babel-plugin-import-jsx-pragma',
Expand Down
Loading