[MM-68143] Fix ESLint --ext flags to include dot prefix for file extensions#1145
[MM-68143] Fix ESLint --ext flags to include dot prefix for file extensions#1145M-ZubairAhmed wants to merge 3 commits intomainfrom
Conversation
…iles - Introduced a new .eslintignore file in the standalone directory to exclude node_modules and dist from linting. - Updated lint and fix scripts in both standalone and webapp package.json files to simplify the ESLint command by removing ignore patterns for node_modules and dist, and added support for .tsx files.
- Added 'node_modules/', 'dist/', and 'lib/' to the .eslintignore file to prevent linting of these directories, ensuring a cleaner linting process.
📝 WalkthroughWalkthroughThe changes consolidate ESLint configuration across webapp and standalone directories by moving ignore patterns into dedicated Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
webapp/package.json (1)
13-14: Consider keeping afixalias for backward compatibility.Renaming to
lint:fixis fine, but preservingfixavoids breaking existing local/automation workflows that still callnpm run fix.Proposed compatibility alias
"scripts": { "preinstall": "./install_mattermost_webapp.sh", "build": "webpack --mode=production", "build:watch": "webpack --mode=production --watch", "debug": "webpack --mode=none", "debug:watch": "webpack --mode=development --watch", "lint": "eslint --ext .js,.jsx,.tsx,.ts . --quiet --cache", + "fix": "npm run lint:fix", "lint:fix": "eslint --ext .js,.jsx,.tsx,.ts . --quiet --fix --cache",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@webapp/package.json` around lines 13 - 14, Add a backward-compatible "fix" npm script that mirrors the existing "lint:fix" behavior so callers of npm run fix continue to work; update the package.json "scripts" section to include a "fix" entry that either duplicates the "lint:fix" command or forwards to it (e.g., run the same eslint args or invoke "npm run lint:fix"), ensuring the new "fix" script name coexists with "lint" and "lint:fix".
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@webapp/package.json`:
- Around line 13-14: Add a backward-compatible "fix" npm script that mirrors the
existing "lint:fix" behavior so callers of npm run fix continue to work; update
the package.json "scripts" section to include a "fix" entry that either
duplicates the "lint:fix" command or forwards to it (e.g., run the same eslint
args or invoke "npm run lint:fix"), ensuring the new "fix" script name coexists
with "lint" and "lint:fix".
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6a203336-78e2-46f4-8d37-3378516171e4
📒 Files selected for processing (5)
Makefilestandalone/.eslintignorestandalone/package.jsonwebapp/.eslintignorewebapp/package.json
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1145 +/- ##
==========================================
- Coverage 24.12% 24.05% -0.08%
==========================================
Files 237 237
Lines 13540 13540
Branches 1611 1611
==========================================
- Hits 3267 3257 -10
- Misses 9964 9975 +11
+ Partials 309 308 -1 🚀 New features to boost your workflow:
|
Summary
lintandlint:fixscripts in bothwebapp/package.jsonandstandalone/package.jsonby removing explicit--ignore-patternflags and relying on.eslintignorefiles instead.webapp/.eslintignoreand addedstandalone/.eslintignoreto ignorenode_modules/,dist/, and (for webapp)lib/directories,Makefileto remove.eslintcachefiles from bothwebappandstandaloneTicket Link
Fixes https://mattermost.atlassian.net/browse/MM-68143