Skip to content

Commit 33f2734

Browse files
kdmccormickjawad-khan
authored andcommitted
build(eslint): Ignore Symlinks and Reduce Violation Limit (#36010)
Background: We have a large number of standing eslint violations in our legacy frontends. Rather than fixing or amnesty-ing all of them, we've opted to use a simple integer limit of violations. Exceeding this limit causes the quality check to fail. Before we moved eslint off of Paver [1], the limit was unreasonably high (probably due to deprecations that removed violation-rich frontend code). This was good, except for the fact that we essentially weren't catching when new violations creeped into the JS code. So, in [1], we lowered the limit down to the lowest possible value, which we thought was 1285. However, we've found that this made the check flaky-- turned out, we have been unintentionally double-counting various violations due to the symlinks in edx-platform. Some of those symlinks' existence is dependent on whether and how `npm ci` and `npm run build` have been run. As a result, 1285 would pass in some contexts, and fail in other contexts. The fix is to simply add all the relevant edx-platform symlinks to .eslintignore. This allows us to lower the violations limit to 734. [1] #35159
1 parent 1e34035 commit 33f2734

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

.eslintignore

+13-1
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,21 @@ test_root/staticfiles
2020
common/static/xmodule
2121

2222

23-
# Symlinks into xmodule/js
23+
# Various intra-repo symlinks that we've added over the years to duct-tape the JS build together.
24+
# Ignore them so that we're not double-counting these violations.
25+
cms/static/edx-ui-toolkit
2426
cms/static/xmodule_js
27+
lms/static/common
28+
lms/static/course_bookmarks
29+
lms/static/course_experience
30+
lms/static/course_search
31+
lms/static/discussion
32+
lms/static/edx-ui-toolkit
33+
lms/static/learner_profile
34+
lms/static/support
35+
lms/static/teams
2536
lms/static/xmodule_js
37+
xmodule/js/common_static
2638

2739

2840
# Mako templates that generate .js files

scripts/eslint.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def run_eslint():
2525
Runs eslint on static asset directories.
2626
If limit option is passed, fails build if more violations than the limit are found.
2727
"""
28-
violations_limit = 1285
28+
violations_limit = 734
2929

3030
command = [
3131
"node",

0 commit comments

Comments
 (0)