Skip to content
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

fix(deps): update to prettier 3.3.3, stylelint-prettier 5.0.2 #17799

Merged
merged 26 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
7fde43f
ci: stylelint16_upgrade
2nikhiltom Oct 16, 2024
ebf8c0f
fix: dedupe changes
2nikhiltom Oct 16, 2024
70bc5fd
fix: updates to stylelint16
2nikhiltom Oct 16, 2024
aa60128
refactor: added old rules back
2nikhiltom Oct 16, 2024
137d285
refactor: revert rules
2nikhiltom Oct 16, 2024
91df27b
fix: updates SCSS files & migrate to Stylelint 16.0.0
2nikhiltom Oct 17, 2024
2a54f57
refactor: null check
2nikhiltom Oct 17, 2024
e7b1c5e
chore: resolved conflicts
2nikhiltom Oct 17, 2024
a78c4f7
chore: yarn dedupe changes
2nikhiltom Oct 17, 2024
cf10688
Merge branch 'main' into stylelint16_update
2nikhiltom Oct 17, 2024
9a9f15e
refactor: refined package.json, updated rules object
2nikhiltom Oct 17, 2024
389af60
refactor: cleaned comments & package.json
2nikhiltom Oct 17, 2024
35bec71
refactor: cleaned rules object
2nikhiltom Oct 17, 2024
0313b53
Merge branch 'main' into stylelint16_update
2nikhiltom Oct 18, 2024
c7f2e13
fix(deps): update stylelint16 & prettier3
2nikhiltom Oct 18, 2024
25ca6ae
fix(deps): stylelint-prettier5
2nikhiltom Oct 18, 2024
4d7ba59
fix(test): update test utils to use prettier v2
tay1orjones Oct 18, 2024
b5ae11c
chore: run yarn format w/ prettier 3
tay1orjones Oct 18, 2024
ba50c85
chore: run yarn format with prettier 3
tay1orjones Oct 18, 2024
6eef3af
Merge branch 'main' of github.com:carbon-design-system/carbon into st…
tay1orjones Oct 18, 2024
153288b
chore: run yarn format
tay1orjones Oct 18, 2024
8d327e2
Merge branch 'main' into stylelint16-prettier3-eslint-plugin-prettier…
tay1orjones Oct 18, 2024
24987e0
chore(deps): upgrade prettier to 3.3.3
kennylam Oct 23, 2024
6615271
Merge branch 'main' of github.com:carbon-design-system/carbon into st…
kennylam Oct 23, 2024
cf33b7e
chore(prettier): format code
kennylam Oct 23, 2024
5e3f675
chore(prettier): format code
kennylam Oct 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
2 changes: 1 addition & 1 deletion config/eslint-config-carbon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@
},
"devDependencies": {
"babel-preset-carbon": "workspace:^",
"prettier": "^2.8.8"
"prettier": "^3.3.3"
}
}
3 changes: 2 additions & 1 deletion config/stylelint-config-carbon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@
"stylelint-config-standard-scss": "^13.1.0",
"stylelint-no-unsupported-browser-features": "^8.0.1",
"stylelint-order": "^6.0.0",
"stylelint-prettier": "^5.0.0",
"stylelint-scss": "^6.2.1",
"stylelint-use-logical": "^2.1.0"
},
"devDependencies": {
"prettier": "^2.8.8",
"prettier": "^3.3.3",
"stylelint": "^16.0.0"
}
}
3 changes: 1 addition & 2 deletions docs/guides/icons.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,7 @@ update PR:
`--modifiers`. All icons with `--modifiers` are listed as variants of the
same icon.
3. make desired edits on the icon's `aliases` list.
4. commit changes, preferably with a commit message "[icon name] metadata
update".
4. commit changes, preferably with a commit message "[icon name] metadata update".
5. create a new branch, suggested branch name is `yourname-metadata-iconName`
6. create the PR from your branch, or click on `Propose file change` if you are
in browser.
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/support.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ started in case you get stuck.
- “Could you share more about what you’ve already tried?”
- “Can you share more about your usecase?”
- “Can you add a repro (reproduction) using Stackblitz?”
- “After searching through [FILL IN RESOURCE HERE], I was able to find this and
thought it might be helpful... Let me know if that works.”
- “After searching through [FILL IN RESOURCE HERE], I was able to find this and thought
it might be helpful... Let me know if that works.”

### What does "ongoing support" mean regarding GitHub?

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"jest-junit": "^16.0.0",
"lerna": "^8.0.0",
"lint-staged": "^15.0.0",
"prettier": "^2.8.8",
"prettier": "^3.3.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rimraf": "^5.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"klaw-sync": "^6.0.0",
"lodash.template": "^4.5.0",
"markdown-toc": "^1.2.0",
"prettier": "^2.8.8",
"prettier": "^3.3.3",
"prettier-config-carbon": "^0.11.0",
"progress-estimator": "^0.3.0",
"remark": "^10.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/sassdoc/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

'use strict';

const prettier = require('prettier');
const prettier = require('prettier2');
const sassdoc = require('sassdoc');
const toc = require('markdown-toc');

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/sync/readme.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

const fs = require('fs-extra');
const path = require('path');
const prettier = require('prettier');
const prettier = require('prettier2');
const prettierConfig = require('prettier-config-carbon');
const createRemark = require('remark');
const monorepo = require('./remark/remark-monorepo');
Expand Down
2 changes: 1 addition & 1 deletion packages/colors/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ async function build() {
const MODULES_ENTRYPOINT = path.resolve(__dirname, '..', 'index.scss');

await Promise.all([
fs.writeFile(MODULES_ENTRYPOINT, generate(sassModule).code),
fs.writeFile(MODULES_ENTRYPOINT, await generate(sassModule).code),
]);
}

Expand Down
5 changes: 4 additions & 1 deletion packages/feature-flags/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ async function main() {
'../scss/generated/feature-flags.scss'
);
await fs.ensureFile(generatedSassFilepath);
await fs.writeFile(generatedSassFilepath, buildSassModule(featureFlags));
await fs.writeFile(
generatedSassFilepath,
await buildSassModule(featureFlags)
);
}

const sassBanner = ` Code generated by @carbon/feature-flags. DO NOT EDIT.
Expand Down
12 changes: 8 additions & 4 deletions packages/grid/scss/_css-grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,10 @@
// Condensed
.#{$prefix}--css-grid--condensed {
--cds-grid-gutter: #{$grid-gutter-condensed};
--cds-grid-column-hang: #{math.div($grid-gutter, 2) -
math.div($grid-gutter-condensed, 2)};
--cds-grid-column-hang: #{math.div($grid-gutter, 2) - math.div(
$grid-gutter-condensed,
2
)};
}

// -----------------------------------------------------------------------------
Expand Down Expand Up @@ -179,8 +181,10 @@
.#{$prefix}--subgrid--condensed {
--cds-grid-gutter-start: #{math.div($grid-gutter-condensed, 2)};
--cds-grid-gutter-end: #{math.div($grid-gutter-condensed, 2)};
--cds-grid-column-hang: #{math.div($grid-gutter, 2) -
math.div($grid-gutter-condensed, 2)};
--cds-grid-column-hang: #{math.div($grid-gutter, 2) - math.div(
$grid-gutter-condensed,
2
)};
}

// -----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion packages/icon-build-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"js-yaml": "^3.12.1",
"klaw-sync": "^6.0.0",
"memfs": "^4.0.0",
"prettier": "^2.8.8",
"prettier": "^3.3.3",
"prop-types": "^15.6.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
5 changes: 2 additions & 3 deletions packages/icon-build-helpers/src/builders/vanilla.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@
for (const m of modules) {
files[m.filepath] = m.source;
input[m.filepath] = m.filepath;
files[
'index.js'
] += `\nexport { default as ${m.moduleName} } from '${m.filepath}';`;
files['index.js'] +=

Check warning on line 60 in packages/icon-build-helpers/src/builders/vanilla.js

View check run for this annotation

Codecov / codecov/patch

packages/icon-build-helpers/src/builders/vanilla.js#L60

Added line #L60 was not covered by tests
`\nexport { default as ${m.moduleName} } from '${m.filepath}';`;
}

const bundle = await rollup({
Expand Down
5 changes: 2 additions & 3 deletions packages/icon-build-helpers/src/builders/vue/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,8 @@
for (const m of modules) {
files[m.filepath] = m.source;
input[m.filepath] = m.filepath;
files[
'index.js'
] += `\nexport { default as ${m.moduleName} } from '${m.filepath}';`;
files['index.js'] +=

Check warning on line 76 in packages/icon-build-helpers/src/builders/vue/builder.js

View check run for this annotation

Codecov / codecov/patch

packages/icon-build-helpers/src/builders/vue/builder.js#L76

Added line #L76 was not covered by tests
`\nexport { default as ${m.moduleName} } from '${m.filepath}';`;
}

const bundle = await rollup({
Expand Down
2 changes: 1 addition & 1 deletion packages/icons-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@carbon/cli-reporter": "^10.7.0",
"@carbon/icons": "^11.52.0",
"fs-extra": "^11.0.0",
"prettier": "^2.8.8",
"prettier": "^3.3.3",
"rimraf": "^6.0.0",
"rollup": "^2.79.1",
"vue": "^2.6.8"
Expand Down
2 changes: 1 addition & 1 deletion packages/layout/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ async function build() {
await fs.ensureDir(SCSS_DIR);
for (const { filepath, builder } of files) {
const { code } = generate(builder());
await fs.writeFile(filepath, code);
await fs.writeFile(filepath, await code);
}

reporter.success('Done! 🎉');
Expand Down
1 change: 1 addition & 0 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
"mini-css-extract-plugin": "^2.4.5",
"postcss": "^8.4.5",
"postcss-loader": "^8.0.0",
"prettier2": "npm:prettier@2",
"process": "^0.11.10",
"prop-types": "^15.7.2",
"react": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Button/ButtonBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { useId } from '../../internal/useId';
import { ButtonBaseProps, ButtonProps } from './Button';

const ButtonBase = React.forwardRef(function ButtonBase<
T extends React.ElementType
T extends React.ElementType,
>(
{
as,
Expand Down
12 changes: 6 additions & 6 deletions packages/react/src/components/ComboBox/ComboBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -527,12 +527,12 @@
typeahead
? autocompleteCustomFilter({ item: itemToString(item), inputValue })
: shouldFilterItem
? shouldFilterItem({
item,
itemToString,
inputValue,
})
: defaultShouldFilterItem()
? shouldFilterItem({
item,
itemToString,
inputValue,
})
: defaultShouldFilterItem()

Check warning on line 535 in packages/react/src/components/ComboBox/ComboBox.tsx

View check run for this annotation

Codecov / codecov/patch

packages/react/src/components/ComboBox/ComboBox.tsx#L535

Added line #L535 was not covered by tests
);

useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Heading/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type SectionProps<E extends ElementType> = PolymorphicProps<
>;

export const Section = React.forwardRef(function Section<
E extends ElementType = 'section'
E extends ElementType = 'section',
>(
{
as: BaseComponent = 'section' as E,
Expand Down
135 changes: 67 additions & 68 deletions packages/react/src/components/InlineCheckbox/InlineCheckbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,79 +12,78 @@
import { useMergedRefs } from '../../internal/useMergedRefs';

/** @type any */
const InlineCheckbox = React.forwardRef(function InlineCheckbox(
props,
forwardRef
) {
const {
['aria-label']: ariaLabel,
ariaLabel: deprecatedAriaLabel,
checked = false,
disabled,
id,
indeterminate,
name,
onChange = () => {},
onClick,
onKeyDown,
title,
} = props;
const prefix = usePrefix();
const inputRef = useRef(null);
const ref = useMergedRefs([inputRef, forwardRef]);
const inputProps = {
checked,
className: `${prefix}--checkbox`,
disabled,
id,
name,
onClick: onClick ? onClickCheckBoxInput : onClick,
onChange: (evt) => {
onChange(evt.target.checked, id, evt);
},
onKeyDown,
ref,
type: 'checkbox',
};

if (indeterminate) {
inputProps.checked = false;
}

useEffect(() => {
if (inputRef?.current) {
inputRef.current.indeterminate = indeterminate;
}
}, [indeterminate]);
const InlineCheckbox = React.forwardRef(
function InlineCheckbox(props, forwardRef) {
const {
['aria-label']: ariaLabel,
ariaLabel: deprecatedAriaLabel,
checked = false,
disabled,
id,
indeterminate,
name,
onChange = () => {},
onClick,
onKeyDown,
title,
} = props;
const prefix = usePrefix();
const inputRef = useRef(null);
const ref = useMergedRefs([inputRef, forwardRef]);
const inputProps = {
checked,
className: `${prefix}--checkbox`,
disabled,
id,
name,
onClick: onClick ? onClickCheckBoxInput : onClick,
onChange: (evt) => {
onChange(evt.target.checked, id, evt);
},
onKeyDown,
ref,
type: 'checkbox',
};

function onClickCheckBoxInput(evt) {
// If the previous "indeterminate" is true, change "checked" to false. If it is not undefined, we're working on `TableSelectAll`
if (indeterminate) {
evt.target.checked = false;
inputProps.checked = false;
}
onClick(evt);
}

return (
<div className={`${prefix}--checkbox--inline`}>
<input {...inputProps} />
{
/* eslint-disable jsx-a11y/label-has-for,jsx-a11y/label-has-associated-control,jsx-a11y/click-events-have-key-events,jsx-a11y/no-noninteractive-element-interactions */
<label
htmlFor={id}
className={`${prefix}--checkbox-label`}
title={title}
onClick={(evt) => {
evt.stopPropagation();
}}>
<span className={`${prefix}--visually-hidden`}>
{deprecatedAriaLabel || ariaLabel}
</span>
</label>
useEffect(() => {
if (inputRef?.current) {
inputRef.current.indeterminate = indeterminate;
}
</div>
);
});
}, [indeterminate]);

function onClickCheckBoxInput(evt) {
// If the previous "indeterminate" is true, change "checked" to false. If it is not undefined, we're working on `TableSelectAll`
if (indeterminate) {
evt.target.checked = false;
}
onClick(evt);
}

return (
<div className={`${prefix}--checkbox--inline`}>
<input {...inputProps} />
{
/* eslint-disable jsx-a11y/label-has-for,jsx-a11y/label-has-associated-control,jsx-a11y/click-events-have-key-events,jsx-a11y/no-noninteractive-element-interactions */
<label
htmlFor={id}
className={`${prefix}--checkbox-label`}
title={title}
onClick={(evt) => {
evt.stopPropagation();

Check warning on line 76 in packages/react/src/components/InlineCheckbox/InlineCheckbox.js

View check run for this annotation

Codecov / codecov/patch

packages/react/src/components/InlineCheckbox/InlineCheckbox.js#L75-L76

Added lines #L75 - L76 were not covered by tests
}}>
<span className={`${prefix}--visually-hidden`}>
{deprecatedAriaLabel || ariaLabel}
</span>
</label>
}
</div>
);
}
);

InlineCheckbox.propTypes = {
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Layer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export interface LayerComponent {
}

const LayerRenderFunction = React.forwardRef(function Layer<
T extends React.ElementType
T extends React.ElementType,
>(
{
as = 'div' as T,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ export interface FilterableMultiSelectProps<ItemType>
}

const FilterableMultiSelect = React.forwardRef(function FilterableMultiSelect<
ItemType
ItemType,
>(
{
autoAlign = false,
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/components/Search/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ const Search = React.forwardRef<HTMLInputElement, SearchProps>(function Search(
onExpand && isExpanded
? true
: onExpand && !isExpanded
? false
: undefined
? false
: undefined
}
aria-controls={onExpand ? uniqueId : undefined}>
<CustomSearchIcon icon={renderIcon} />
Expand Down
Loading
Loading