Lint generate-code-scanning-query-list.ts separately (#50031)
This commit is contained in:
@@ -71,6 +71,20 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
token: ${{ secrets.DOCS_BOT_PAT_WORKFLOW }}
|
token: ${{ secrets.DOCS_BOT_PAT_WORKFLOW }}
|
||||||
|
|
||||||
|
- name: Lint the code (eslint)
|
||||||
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
|
env:
|
||||||
|
PATH: '$PATH:${{ github.workspace }}/node_modules/.bin'
|
||||||
|
run: |
|
||||||
|
eslint --no-ignore src/code-scanning/scripts/generate-code-scanning-query-list.ts
|
||||||
|
|
||||||
|
- name: Lint the code (tsc)
|
||||||
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
|
env:
|
||||||
|
PATH: '$PATH:${{ github.workspace }}/node_modules/.bin'
|
||||||
|
run: |
|
||||||
|
tsc --noEmit --project src/code-scanning/scripts/tsconfig.json
|
||||||
|
|
||||||
- name: Build code scanning query list
|
- name: Build code scanning query list
|
||||||
run: |
|
run: |
|
||||||
for lang in "cpp" "csharp" "go" "java" "javascript" "python" "ruby" "swift"; do
|
for lang in "cpp" "csharp" "go" "java" "javascript" "python" "ruby" "swift"; do
|
||||||
|
|||||||
4
.github/workflows/lint-code.yml
vendored
4
.github/workflows/lint-code.yml
vendored
@@ -39,10 +39,6 @@ jobs:
|
|||||||
|
|
||||||
- uses: ./.github/actions/node-npm-setup
|
- uses: ./.github/actions/node-npm-setup
|
||||||
|
|
||||||
- uses: ./.github/actions/install-cocofix
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.DOCS_BOT_PAT_WORKFLOW }}
|
|
||||||
|
|
||||||
- name: Run linter
|
- name: Run linter
|
||||||
run: npm run lint
|
run: npm run lint
|
||||||
|
|
||||||
|
|||||||
@@ -193,7 +193,8 @@
|
|||||||
"src/bookmarklets/*",
|
"src/bookmarklets/*",
|
||||||
"src/open-source/scripts/add-pr-links.js",
|
"src/open-source/scripts/add-pr-links.js",
|
||||||
"src/open-source/scripts/pr-link-source.js",
|
"src/open-source/scripts/pr-link-source.js",
|
||||||
"rest-api-description/"
|
"rest-api-description/",
|
||||||
|
"src/code-scanning/scripts/generate-code-scanning-query-list.ts"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"jest": {
|
"jest": {
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ async function main(options: Options, language: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function printQueries(options: Options, queries: QueryExtended[], includeAutofix: boolean) {
|
function printQueries(options: Options, queries: QueryExtended[], includeAutofix: boolean) {
|
||||||
const markdown = []
|
const markdown: string[] = []
|
||||||
markdown.push('{% rowheaders %}')
|
markdown.push('{% rowheaders %}')
|
||||||
markdown.push('') // blank line
|
markdown.push('') // blank line
|
||||||
const header = ['Query name', 'Related CWEs', 'Default', 'Extended']
|
const header = ['Query name', 'Related CWEs', 'Default', 'Extended']
|
||||||
|
|||||||
5
src/code-scanning/scripts/tsconfig.json
Normal file
5
src/code-scanning/scripts/tsconfig.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../../tsconfig.json",
|
||||||
|
"include": ["generate-code-scanning-query-list.ts"],
|
||||||
|
"exclude": ["node_modules"]
|
||||||
|
}
|
||||||
@@ -26,7 +26,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules"
|
"node_modules",
|
||||||
|
"src/code-scanning/scripts/generate-code-scanning-query-list.ts"
|
||||||
],
|
],
|
||||||
"include": [
|
"include": [
|
||||||
"*.d.ts",
|
"*.d.ts",
|
||||||
|
|||||||
Reference in New Issue
Block a user