File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22
3+ set -euo pipefail
4+
35# Run eslint with custom reporting:
46npx eslint -f scripts/eslint-json-relative.js . > build/eslint.json
57npx ts-node scripts/lint-code.ts build/eslint.json
Original file line number Diff line number Diff line change 11import * as fs from "fs"
2+ import path from "path"
23
34type ESLintSupression = {
45 kind : string
@@ -39,6 +40,13 @@ if (process.argv.length < 3) {
3940 console . error ( "Missing arguments: Path to eslint json file" )
4041 process . exit ( 1 )
4142}
43+ const filePath = path . normalize ( process . argv [ 2 ] )
44+ if ( filePath . includes ( ".." ) ) {
45+ console . error (
46+ `Invalid path to eslint json file: '${ filePath } ' must not contain '..'!` ,
47+ )
48+ process . exit ( 1 )
49+ }
4250const results = JSON . parse (
4351 fs . readFileSync ( process . argv [ 2 ] , "utf8" ) ,
4452) as ESLintEntry [ ]
You can’t perform that action at this time.
0 commit comments