-
Notifications
You must be signed in to change notification settings - Fork 3
Eslint v9 Migration: Foundation stylelint rules migration to eslint v9 (hardcoded rules) #203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
* using esbuild to bundle shared-util * Rules metadata moved to shared utils * cleaning package json before pack and publish for removing slds-shared-utils
@riteshiitbbs007 |
@sf-nithappu I feel this provides a clean architecture which supports ESLint-first future. // Phase 1: Both platforms use shared utils // Phase 2: Gradual stylelint deprecation // Phase 3: ESLint-only future |
@riteshiitbbs007 we can make use of plugin to bundle required files from stylelint plugin in much clearer way with less changes #220 |
@sf-nithappu I still feel for all files the imports will not be as easy as ruleMetadata here, also won't it bring an additional change when deprecating stylelint to refactor ESLint and bring those code in here? |
…essfully enables you to retain packages: 'external' while ensuring slds-shared-utils gets bundled correctly
import noHardcodedValuesSlds2 from './v9/rules/no-hardcoded-values-slds2'; | ||
import cssPlugin from "@eslint/css"; | ||
|
||
const rules = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to new file and export rules object. Helps in implementing internal persona
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sf-nithappu can we do this in a separate PR once this lands?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed but not necessarily in this PR
"@salesforce-ux/sds-metadata": "^0.2.4" | ||
"@salesforce-ux/sds-metadata": "^0.2.4", | ||
"postcss-value-parser": "^4.2.0", | ||
"slds-shared-utils": "*" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding "slds-shared-utils
as dependency is not required
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sf-nithappu I see, beacuse of Monorepo Workspace Resolution it will work without this but isn't this better to keep for Clarity? Does keeping this pose any issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No its not. Remove entry or add it under devdependencies
. This pkage is need only during dev.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was already removed.
"prepublishOnly": "clean-pkg-json" | ||
"prepack": "npm pkg delete dependencies.slds-shared-utils", | ||
"postpack": "npm pkg set dependencies.slds-shared-utils='*'", | ||
"prepublishOnly": "npm pkg delete dependencies.slds-shared-utils && clean-pkg-json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert these lines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
packages/stylelint-plugin-slds/src/rules/enforce-component-hook-naming-convention/index.ts
Show resolved
Hide resolved
packages/stylelint-plugin-slds/src/rules/enforce-sds-to-slds-hooks/index.ts
Show resolved
Hide resolved
…y treating internal modules as external imports
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
300 lines file, can be modularise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
This PR migrates stylelint rule**(no-hardcoded-values-slds1/slds2)** to ESLint v9 while ensuring robust support for both stylelint-plugin-slds and eslint-plugin-slds on style files. By default, the CLI now runs both linters on CSS/SCSS/etc. files for maximum coverage and migration safety. All logic is programmatically controlled—no CLI flag required.