Skip to content

Commit df5db71

Browse files
Implemented suggestions
1 parent 314d235 commit df5db71

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

.github/workflows/pull-request.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,16 +195,15 @@ jobs:
195195
id: changed-files
196196
uses: tj-actions/changed-files@v45
197197

198-
- name: Filter TypeScript files
199-
id: filter-files
200-
run: |
201-
echo "ts_files=$(echo '${{ steps.changed-files.outputs.all_changed_files }}' | tr ',' '\n' | grep -E '\.(ts|tsx)$' | tr '\n' ' ')" >> $GITHUB_OUTPUT
202-
shell: bash
198+
- name: Set up Python
199+
uses: actions/setup-python@v5
200+
with:
201+
python-version: 3.9
203202

204203
- name: Run Python script
205-
if: steps.filter-files.outputs.ts_files != ''
206204
run: |
207-
python .github/workflows/scripts/eslint_disable_check.py --files ${{ steps.filter-files.outputs.ts_files }}
205+
python .github/workflows/scripts/eslint_disable_check.py --files ${{ steps.changed-files.outputs.all_changed_files }}
206+
208207
209208
Check-Code-Coverage-Disable:
210209
name: Check for code coverage disable

.github/workflows/scripts/eslint_disable_check.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ def has_eslint_disable(file_path):
3838
"""
3939
# Initialize key variables
4040
eslint_disable_pattern = re.compile(
41-
r"\/\/\s*eslint-disable(?:-next-line|-line)?[^\n]*|"
42-
r"\/\*\s*eslint-disable[^\*]*\*\/|"
43-
r"\/\*[\s\S]*?eslint-disable[\s\S]*?\*\/",
41+
r"\/\/.*eslint-disable.*|\/\*[\s\S]*?eslint-disable[\s\S]*?\*\/",
4442
re.IGNORECASE | re.DOTALL,
4543
)
4644

@@ -86,7 +84,7 @@ def check_eslint(files_or_directories):
8684
file_path = os.path.join(root, file_name)
8785
if has_eslint_disable(file_path):
8886
print(
89-
f"Error: File {item} contains "
87+
f"Error: File {file_path} contains "
9088
"eslint-disable statements."
9189
)
9290

src/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ function app(): JSX.Element {
9999

100100
const { data, loading } = useQuery(CHECK_AUTH);
101101

102+
/* eslint-disable-next-line */
103+
102104
useEffect(() => {
103105
if (!loading && data?.checkAuth) {
104106
const auth = data.checkAuth;

0 commit comments

Comments
 (0)