0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-27 13:53:09 +00:00

Compare commits

...

10 Commits

Author SHA1 Message Date
Trevor Buckner
2f1ade8463 lint 2025-01-31 13:38:25 -05:00
Trevor Buckner
518924d725 Use import, run eslint 2025-01-31 13:36:42 -05:00
Trevor Buckner
6269651c8d Update Marked to v13.0.3 2025-01-31 12:42:54 -05:00
Trevor Buckner
899004cfaf Merge pull request #4017 from naturalcrit/dependabot/npm_and_yarn/react-router-7.1.4
Bump react-router from 7.1.3 to 7.1.4
2025-01-31 00:35:03 -05:00
dependabot[bot]
7e826cd4f5 Bump react-router from 7.1.3 to 7.1.4
Bumps [react-router](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router) from 7.1.3 to 7.1.4.
- [Release notes](https://github.com/remix-run/react-router/releases)
- [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router/CHANGELOG.md)
- [Commits](https://github.com/remix-run/react-router/commits/react-router@7.1.4/packages/react-router)

---
updated-dependencies:
- dependency-name: react-router
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-31 05:22:30 +00:00
Trevor Buckner
3b150891bc Merge pull request #4016 from naturalcrit/dependabot/npm_and_yarn/dompurify-3.2.4
Bump dompurify from 3.2.3 to 3.2.4
2025-01-31 00:21:09 -05:00
dependabot[bot]
e87acc3f0f Bump dompurify from 3.2.3 to 3.2.4
Bumps [dompurify](https://github.com/cure53/DOMPurify) from 3.2.3 to 3.2.4.
- [Release notes](https://github.com/cure53/DOMPurify/releases)
- [Commits](https://github.com/cure53/DOMPurify/compare/3.2.3...3.2.4)

---
updated-dependencies:
- dependency-name: dompurify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-31 05:17:57 +00:00
Trevor Buckner
b1e99f1385 Marked 12.0.2 2025-01-31 00:16:37 -05:00
Trevor Buckner
4e0b6d634d Marked 12.0.1 2025-01-31 00:12:13 -05:00
Trevor Buckner
a72f0f2f34 Merge pull request #4018 from naturalcrit/up-Marked-to-v12
Update Marked.js to v12.0.0
2025-01-31 00:08:01 -05:00
6 changed files with 127 additions and 125 deletions

View File

@@ -43,6 +43,6 @@
"@stylistic/media-feature-colon-space-before" : "always", "@stylistic/media-feature-colon-space-before" : "always",
"@stylistic/media-feature-colon-space-after" : "always", "@stylistic/media-feature-colon-space-after" : "always",
"naturalcrit/declaration-colon-align" : true, "naturalcrit/declaration-colon-align" : true,
"naturalcrit/declaration-block-multi-line-min-declarations": 1 "naturalcrit/declaration-block-multi-line-min-declarations" : 1
} }
} }

36
package-lock.json generated
View File

@@ -23,7 +23,7 @@
"cors": "^2.8.5", "cors": "^2.8.5",
"create-react-class": "^15.7.0", "create-react-class": "^15.7.0",
"dedent-tabs": "^0.10.3", "dedent-tabs": "^0.10.3",
"dompurify": "^3.2.3", "dompurify": "^3.2.4",
"expr-eval": "^2.0.2", "expr-eval": "^2.0.2",
"express": "^4.21.2", "express": "^4.21.2",
"express-async-handler": "^1.2.0", "express-async-handler": "^1.2.0",
@@ -34,10 +34,10 @@
"jwt-simple": "^0.5.6", "jwt-simple": "^0.5.6",
"less": "^3.13.1", "less": "^3.13.1",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"marked": "12.0.0", "marked": "13.0.3",
"marked-emoji": "^1.4.3", "marked-emoji": "^1.4.3",
"marked-extended-tables": "^1.1.0", "marked-extended-tables": "^1.1.0",
"marked-gfm-heading-id": "^3.2.0", "marked-gfm-heading-id": "^4.0.1",
"marked-smartypants-lite": "^1.0.3", "marked-smartypants-lite": "^1.0.3",
"markedLegacy": "npm:marked@^0.3.19", "markedLegacy": "npm:marked@^0.3.19",
"moment": "^2.30.1", "moment": "^2.30.1",
@@ -47,7 +47,7 @@
"react": "^18.3.1", "react": "^18.3.1",
"react-dom": "^18.3.1", "react-dom": "^18.3.1",
"react-frame-component": "^4.1.3", "react-frame-component": "^4.1.3",
"react-router": "^7.1.3", "react-router": "^7.1.4",
"sanitize-filename": "1.6.3", "sanitize-filename": "1.6.3",
"superagent": "^10.1.1", "superagent": "^10.1.1",
"vitreum": "git+https://git@github.com/calculuschild/vitreum.git" "vitreum": "git+https://git@github.com/calculuschild/vitreum.git"
@@ -5313,9 +5313,10 @@
} }
}, },
"node_modules/dompurify": { "node_modules/dompurify": {
"version": "3.2.3", "version": "3.2.4",
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.2.3.tgz", "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.2.4.tgz",
"integrity": "sha512-U1U5Hzc2MO0oW3DF+G9qYN0aT7atAou4AgI0XjWz061nyBPbdxkfdhfy5uMgGn6+oLFCfn44ZGbdDqCzVmlOWA==", "integrity": "sha512-ysFSFEDVduQpyhzAob/kkuJjf5zWkZD8/A9ywSp1byueyuCfHamrCBa14/Oc2iiB0e51B+NpxSl5gmzn+Ms/mg==",
"license": "(MPL-2.0 OR Apache-2.0)",
"optionalDependencies": { "optionalDependencies": {
"@types/trusted-types": "^2.0.7" "@types/trusted-types": "^2.0.7"
} }
@@ -9788,9 +9789,9 @@
} }
}, },
"node_modules/marked": { "node_modules/marked": {
"version": "12.0.0", "version": "13.0.3",
"resolved": "https://registry.npmjs.org/marked/-/marked-12.0.0.tgz", "resolved": "https://registry.npmjs.org/marked/-/marked-13.0.3.tgz",
"integrity": "sha512-Vkwtq9rLqXryZnWaQc86+FHLC6tr/fycMfYAhiOIXkrNmeGAyhSxjqu0Rs1i0bBqw5u0S7+lV9fdH2ZSVaoa0w==", "integrity": "sha512-rqRix3/TWzE9rIoFGIn8JmsVfhiuC8VIQ8IdX5TfzmeBucdY05/0UlzKaw0eVtpcN/OdVFpBk7CjKGo9iHJ/zA==",
"license": "MIT", "license": "MIT",
"bin": { "bin": {
"marked": "bin/marked.js" "marked": "bin/marked.js"
@@ -9816,15 +9817,15 @@
} }
}, },
"node_modules/marked-gfm-heading-id": { "node_modules/marked-gfm-heading-id": {
"version": "3.2.0", "version": "4.1.1",
"resolved": "https://registry.npmjs.org/marked-gfm-heading-id/-/marked-gfm-heading-id-3.2.0.tgz", "resolved": "https://registry.npmjs.org/marked-gfm-heading-id/-/marked-gfm-heading-id-4.1.1.tgz",
"integrity": "sha512-Xfxpr5lXLDLY10XqzSCA9l2dDaiabQUgtYM9hw8yunyVsB/xYBRpiic6BOiY/EAJw1ik1eWr1ET1HKOAPZBhXg==", "integrity": "sha512-EeQZieAQmsI6c2tWLx0ETd0VjPwLV8qi+HT0dIsfVMERm0rCIuXfRvZXJbo1SgUi++lmuR1LVY+QzgNiLNvVpw==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"github-slugger": "^2.0.0" "github-slugger": "^2.0.0"
}, },
"peerDependencies": { "peerDependencies": {
"marked": ">=4 <13" "marked": ">=13 <16"
} }
}, },
"node_modules/marked-smartypants-lite": { "node_modules/marked-smartypants-lite": {
@@ -11608,9 +11609,10 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/react-router": { "node_modules/react-router": {
"version": "7.1.3", "version": "7.1.4",
"resolved": "https://registry.npmjs.org/react-router/-/react-router-7.1.3.tgz", "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.1.4.tgz",
"integrity": "sha512-EezYymLY6Guk/zLQ2vRA8WvdUhWFEj5fcE3RfWihhxXBW7+cd1LsIiA3lmx+KCmneAGQuyBv820o44L2+TtkSA==", "integrity": "sha512-aJWVrKoLI0nIK1lfbTU3d5al1ZEUiwtSus/xjYL8K5sv2hyPesiOIojHM7QnaNLVtroOB1McZsWk37fMQVoc6A==",
"license": "MIT",
"dependencies": { "dependencies": {
"@types/cookie": "^0.6.0", "@types/cookie": "^0.6.0",
"cookie": "^1.0.1", "cookie": "^1.0.1",

View File

@@ -98,7 +98,7 @@
"cors": "^2.8.5", "cors": "^2.8.5",
"create-react-class": "^15.7.0", "create-react-class": "^15.7.0",
"dedent-tabs": "^0.10.3", "dedent-tabs": "^0.10.3",
"dompurify": "^3.2.3", "dompurify": "^3.2.4",
"expr-eval": "^2.0.2", "expr-eval": "^2.0.2",
"express": "^4.21.2", "express": "^4.21.2",
"express-async-handler": "^1.2.0", "express-async-handler": "^1.2.0",
@@ -109,10 +109,10 @@
"jwt-simple": "^0.5.6", "jwt-simple": "^0.5.6",
"less": "^3.13.1", "less": "^3.13.1",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"marked": "12.0.0", "marked": "13.0.3",
"marked-emoji": "^1.4.3", "marked-emoji": "^1.4.3",
"marked-extended-tables": "^1.1.0", "marked-extended-tables": "^1.1.0",
"marked-gfm-heading-id": "^3.2.0", "marked-gfm-heading-id": "^4.0.1",
"marked-smartypants-lite": "^1.0.3", "marked-smartypants-lite": "^1.0.3",
"markedLegacy": "npm:marked@^0.3.19", "markedLegacy": "npm:marked@^0.3.19",
"moment": "^2.30.1", "moment": "^2.30.1",
@@ -122,7 +122,7 @@
"react": "^18.3.1", "react": "^18.3.1",
"react-dom": "^18.3.1", "react-dom": "^18.3.1",
"react-frame-component": "^4.1.3", "react-frame-component": "^4.1.3",
"react-router": "^7.1.3", "react-router": "^7.1.4",
"sanitize-filename": "1.6.3", "sanitize-filename": "1.6.3",
"superagent": "^10.1.1", "superagent": "^10.1.1",
"vitreum": "git+https://git@github.com/calculuschild/vitreum.git" "vitreum": "git+https://git@github.com/calculuschild/vitreum.git"

View File

@@ -1,5 +1,5 @@
const stylelint = require('stylelint'); import stylelint from 'stylelint';
const { isNumber } = require('stylelint/lib/utils/validateTypes.cjs'); import { isNumber } from 'stylelint/lib/utils/validateTypes.mjs';
const { report, ruleMessages, validateOptions } = stylelint.utils; const { report, ruleMessages, validateOptions } = stylelint.utils;
const ruleName = 'naturalcrit/declaration-block-multi-line-min-declarations'; const ruleName = 'naturalcrit/declaration-block-multi-line-min-declarations';
@@ -7,9 +7,8 @@ const messages = ruleMessages(ruleName, {
expected : (decls)=>`Rule with ${decls} declaration${decls == 1 ? '' : 's'} should be single line`, expected : (decls)=>`Rule with ${decls} declaration${decls == 1 ? '' : 's'} should be single line`,
}); });
const ruleFunction = (primaryOption, secondaryOptionObject, context)=>{
module.exports = stylelint.createPlugin(ruleName, function getPlugin(primaryOption, secondaryOptionObject, context) { return (postcssRoot, postcssResult)=>{
return function lint(postcssRoot, postcssResult) {
const validOptions = validateOptions( const validOptions = validateOptions(
postcssResult, postcssResult,
@@ -20,26 +19,23 @@ module.exports = stylelint.createPlugin(ruleName, function getPlugin(primaryOpti
} }
); );
if(!validOptions) { //If the options are invalid, don't lint if(!validOptions) //If the options are invalid, don't lint
return; return;
}
const isAutoFixing = Boolean(context.fix); const isAutoFixing = Boolean(context.fix);
postcssRoot.walkRules((rule)=>{ //Iterate CSS rules postcssRoot.walkRules((rule)=>{ //Iterate CSS rules
//Apply rule only if all children are decls (no further nested rules) //Apply rule only if all children are decls (no further nested rules)
if(rule.nodes.length > primaryOption || !rule.nodes.every((node)=>node.type === 'decl')) { if(rule.nodes.length > primaryOption || !rule.nodes.every((node)=>node.type === 'decl'))
return; return;
}
//Ignore if already one line //Ignore if already one line
if(!rule.nodes.some((node)=>node.raws.before.includes('\n')) && !rule.raws.after.includes('\n')) if(!rule.nodes.some((node)=>node.raws.before.includes('\n')) && !rule.raws.after.includes('\n'))
return; return;
if(isAutoFixing) { //We are in “fix” mode if(isAutoFixing) { //We are in “fix” mode
rule.each((decl)=>{ rule.each((decl)=>decl.raws.before = ' ');
decl.raws.before = ' ';
});
rule.raws.after = ' '; rule.raws.after = ' ';
} else { } else {
report({ report({
@@ -52,7 +48,9 @@ module.exports = stylelint.createPlugin(ruleName, function getPlugin(primaryOpti
} }
}); });
}; };
}); };
module.exports.ruleName = ruleName; ruleFunction.ruleName = ruleName;
module.exports.messages = messages; ruleFunction.messages = messages;
export default stylelint.createPlugin(ruleName, ruleFunction);

View File

@@ -1,32 +1,29 @@
const stylelint = require('stylelint'); import stylelint from 'stylelint';
const { report, ruleMessages, validateOptions } = stylelint.utils; const { report, ruleMessages, validateOptions } = stylelint.utils;
const ruleName = 'naturalcrit/declaration-colon-align'; const ruleName = 'naturalcrit/declaration-colon-align';
const messages = ruleMessages(ruleName, { const messages = ruleMessages(ruleName, {
expected : (rule)=>`Expected colons aligned within rule "${rule}"`, expected : (rule)=>`Expected colons aligned within rule "${rule}"`,
}); });
const ruleFunction = (primaryOption, secondaryOptionObject, context)=>{
module.exports = stylelint.createPlugin(ruleName, function getPlugin(primaryOption, secondaryOptionObject, context) { return (postcssRoot, postcssResult)=>{
return function lint(postcssRoot, postcssResult) {
const validOptions = validateOptions( const validOptions = validateOptions(
postcssResult, postcssResult,
ruleName, ruleName,
{ {
actual : primaryOption, actual : primaryOption,
possible : [ possible : [true, false]
true,
false
]
} }
); );
if(!validOptions) { //If the options are invalid, don't lint if(!validOptions) // If the options are invalid, don't lint
return; return;
}
const isAutoFixing = Boolean(context.fix); const isAutoFixing = Boolean(context.fix);
postcssRoot.walkRules((rule)=>{ //Iterate CSS rules
postcssRoot.walkRules((rule)=>{ // Iterate CSS rules
let maxColonPos = 0; let maxColonPos = 0;
let misaligned = false; let misaligned = false;
@@ -36,21 +33,24 @@ module.exports = stylelint.createPlugin(ruleName, function getPlugin(primaryOpti
return; return;
const colonPos = declaration.prop.length + declaration.raws.between.indexOf(':'); const colonPos = declaration.prop.length + declaration.raws.between.indexOf(':');
if(maxColonPos > 0 && colonPos != maxColonPos) {
if(maxColonPos > 0 && colonPos != maxColonPos)
misaligned = true; misaligned = true;
}
maxColonPos = Math.max(maxColonPos, colonPos); maxColonPos = Math.max(maxColonPos, colonPos);
}); });
if(misaligned) { if(!misaligned)
if(isAutoFixing) { //We are in “fix” mode return;
if(isAutoFixing) { // We are in “fix” mode
rule.each((declaration)=>{ rule.each((declaration)=>{
if(declaration.type != 'decl') if(declaration.type != 'decl')
return; return;
declaration.raws.between = `${' '.repeat(maxColonPos - declaration.prop.length)}:${declaration.raws.between.split(':')[1]}`; declaration.raws.between = `${' '.repeat(maxColonPos - declaration.prop.length)}:${declaration.raws.between.split(':')[1]}`;
}); });
} else { //We are in “report only” mode } else { // We are in “report only” mode
report({ report({
ruleName, ruleName,
result : postcssResult, result : postcssResult,
@@ -59,10 +59,11 @@ module.exports = stylelint.createPlugin(ruleName, function getPlugin(primaryOpti
word : rule.selector, // Which exact word caused the error? This positions the error properly word : rule.selector, // Which exact word caused the error? This positions the error properly
}); });
} }
}
}); });
}; };
}); };
module.exports.ruleName = ruleName; ruleFunction.ruleName = ruleName;
module.exports.messages = messages; ruleFunction.messages = messages;
export default stylelint.createPlugin(ruleName, ruleFunction);

View File

@@ -1,5 +1,5 @@
const stylelint = require('stylelint'); import stylelint from 'stylelint';
const { isNumber } = require('stylelint/lib/utils/validateTypes.cjs'); import { isNumber } from 'stylelint/lib/utils/validateTypes.mjs';
const { report, ruleMessages, validateOptions } = stylelint.utils; const { report, ruleMessages, validateOptions } = stylelint.utils;
const ruleName = 'naturalcrit/declaration-colon-min-space-before'; const ruleName = 'naturalcrit/declaration-colon-min-space-before';
@@ -7,9 +7,8 @@ const messages = ruleMessages(ruleName, {
expected : (num)=>`Expected at least ${num} space${num == 1 ? '' : 's'} before ":"` expected : (num)=>`Expected at least ${num} space${num == 1 ? '' : 's'} before ":"`
}); });
const ruleFunction = (primaryOption, secondaryOptionObject, context)=>{
module.exports = stylelint.createPlugin(ruleName, function getPlugin(primaryOption, secondaryOptionObject, context) { return (postcssRoot, postcssResult)=>{
return function lint(postcssRoot, postcssResult) {
const validOptions = validateOptions( const validOptions = validateOptions(
postcssResult, postcssResult,
@@ -30,9 +29,9 @@ module.exports = stylelint.createPlugin(ruleName, function getPlugin(primaryOpti
const between = decl.raws.between; const between = decl.raws.between;
const colonIndex = between.indexOf(':'); const colonIndex = between.indexOf(':');
if(between.slice(0, colonIndex).length >= primaryOption) { if(between.slice(0, colonIndex).length >= primaryOption)
return; return;
}
if(isAutoFixing) { //We are in “fix” mode if(isAutoFixing) { //We are in “fix” mode
decl.raws.between = between.slice(0, colonIndex).replace(/\s*$/, ' '.repeat(primaryOption)) + between.slice(colonIndex); decl.raws.between = between.slice(0, colonIndex).replace(/\s*$/, ' '.repeat(primaryOption)) + between.slice(colonIndex);
} else { } else {
@@ -46,7 +45,9 @@ module.exports = stylelint.createPlugin(ruleName, function getPlugin(primaryOpti
} }
}); });
}; };
}); };
module.exports.ruleName = ruleName; ruleFunction.ruleName = ruleName;
module.exports.messages = messages; ruleFunction.messages = messages;
export default stylelint.createPlugin(ruleName, ruleFunction);