-
Notifications
You must be signed in to change notification settings - Fork 102
[OSCI][Enhancement] ts cleanup and precommit #930
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
base: main
Are you sure you want to change the base?
Changes from 5 commits
6a3eeb9
569911e
a35a39a
4c5d3e2
03c258f
4a0fada
1120c12
4742dbc
362d3ab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
kohinoor98 marked this conversation as resolved.
Show resolved
Hide resolved
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,64 @@ | ||
| name: Link Checker | ||
| name: Link Checker and ESLint | ||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [ main ] | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| linkchecker: | ||
| lint-and-link-check: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: Checkout Repository | ||
| uses: actions/checkout@v2 | ||
|
|
||
|
|
||
| # Enable longer filenames for windows | ||
| - name: Enable longer filenames | ||
| if: ${{ matrix.os == 'windows-latest' }} | ||
| run: git config --system core.longpaths true | ||
| - name: Checkout OpenSearch-Dashboards | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| repository: opensearch-project/OpenSearch-Dashboards | ||
| ref: ${{ env.OPENSEARCH_DASHBOARDS_VERSION }} | ||
| path: OpenSearch-Dashboards | ||
| - name: Setup Node | ||
| uses: actions/setup-node@v3 | ||
| with: | ||
| node-version-file: "./OpenSearch-Dashboards/.nvmrc" | ||
| registry-url: "https://registry.npmjs.org" | ||
| - name: Install Yarn | ||
| # Need to use bash to avoid having a windows/linux specific step | ||
| shell: bash | ||
| run: | | ||
| YARN_VERSION=$(node -p "require('./OpenSearch-Dashboards/package.json').engines.yarn") | ||
| echo "Installing yarn@$YARN_VERSION" | ||
| npm i -g yarn@$YARN_VERSION | ||
| - run: node -v | ||
| - run: yarn -v | ||
| - name: Checkout Index Management Dashboards plugin | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| path: OpenSearch-Dashboards/plugins/index-management-dashboards-plugin | ||
| - name: Bootstrap plugin/OpenSearch-Dashboards | ||
| run: | | ||
| cd OpenSearch-Dashboards/plugins/index-management-dashboards-plugin | ||
| yarn osd bootstrap | ||
|
|
||
| - name: Install Dependencies | ||
| run: yarn install | ||
|
|
||
| - name: Run ESLint | ||
| run: yarn eslint:run | ||
| working-directory: OpenSearch-Dashboards/plugins/index-management-dashboards-plugin | ||
|
|
||
| - name: lychee Link Checker | ||
| id: lychee | ||
| uses: lycheeverse/lychee-action@master | ||
| with: | ||
| args: --accept=200,403,429 --exclude=localhost "**/*.html" "**/*.md" "**/*.txt" "**/*.json" | ||
| env: | ||
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
|
|
||
| - name: Fail if there were link errors | ||
| run: exit ${{ steps.lychee.outputs.exit_code }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,9 @@ | ||
| { | ||
| "*.{ts,tsx,js,jsx,json,css,md}": ["prettier --write", "git add"] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we still need this
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For It should be fine. Do you think I should add it as a fail-safe?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good to know 👍 |
||
| "*.{ts,tsx}": [ | ||
| "npx eslint --fix", | ||
| "prettier --write" | ||
| ], | ||
| "*.{js,jsx,json,css,md}": [ | ||
| "prettier --write" | ||
| ] | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.