mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-14 15:03:07 +00:00
Merge branch 'master' into pr/2755
This commit is contained in:
@@ -1,42 +1,48 @@
|
|||||||
{
|
{
|
||||||
"extends": ["stylelint-config-recess-order"],
|
"extends": [
|
||||||
|
"stylelint-config-recess-order",
|
||||||
|
"stylelint-config-recommended"],
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"stylelint-stylistic",
|
"stylelint-stylistic",
|
||||||
"./stylelint_plugins/align-colons.js",
|
"./stylelint_plugins/declaration-colon-align.js",
|
||||||
"./stylelint_plugins/declaration-block-multi-line-min-declarations",
|
"./stylelint_plugins/declaration-colon-min-space-before",
|
||||||
"./stylelint_plugins/declaration-colon-min-space-before"
|
"./stylelint_plugins/declaration-block-multi-line-min-declarations"
|
||||||
],
|
],
|
||||||
"customSyntax": "postcss-less",
|
"customSyntax": "postcss-less",
|
||||||
"rules": {
|
"rules": {
|
||||||
"stylistic/indentation": "tab",
|
"no-descending-specificity" : null,
|
||||||
"stylistic/string-quotes": "double",
|
"at-rule-no-unknown" : null,
|
||||||
"no-duplicate-selectors": true,
|
"function-no-unknown" : null,
|
||||||
"stylistic/color-hex-case": "upper",
|
"font-family-no-missing-generic-family-keyword" : null,
|
||||||
"color-hex-length": "long",
|
"font-weight-notation" : "named-where-possible",
|
||||||
"stylistic/selector-combinator-space-after": "always",
|
"font-family-name-quotes" : "always-unless-keyword",
|
||||||
"stylistic/selector-combinator-space-before": "always",
|
"stylistic/indentation" : "tab",
|
||||||
"selector-attribute-quotes": "always",
|
"no-duplicate-selectors" : true,
|
||||||
"stylistic/selector-attribute-operator-space-before": "always",
|
"stylistic/color-hex-case" : "upper",
|
||||||
"stylistic/selector-attribute-operator-space-after": "always",
|
"color-hex-length" : "long",
|
||||||
"stylistic/selector-attribute-brackets-space-inside": "never",
|
"stylistic/selector-combinator-space-after" : "always",
|
||||||
"stylistic/block-opening-brace-space-before": "always",
|
"stylistic/selector-combinator-space-before" : "always",
|
||||||
"stylistic/declaration-block-trailing-semicolon": "always",
|
"stylistic/selector-attribute-operator-space-before" : "never",
|
||||||
"naturalcrit/declaration-colon-min-space-before": 1,
|
"stylistic/selector-attribute-operator-space-after" : "never",
|
||||||
"stylistic/declaration-colon-space-after": "always",
|
"stylistic/selector-attribute-brackets-space-inside" : "never",
|
||||||
"stylistic/number-leading-zero": "always",
|
"selector-attribute-quotes" : "always",
|
||||||
"function-url-quotes": "always",
|
"selector-pseudo-element-colon-notation" : "double",
|
||||||
"function-url-scheme-disallowed-list": ["data"],
|
"stylistic/selector-pseudo-class-parentheses-space-inside" : "never",
|
||||||
"font-weight-notation": "named-where-possible",
|
"stylistic/block-opening-brace-space-before" : "always",
|
||||||
"font-family-name-quotes": "always-unless-keyword",
|
"naturalcrit/declaration-colon-min-space-before" : 1,
|
||||||
"comment-whitespace-inside": "always",
|
"stylistic/declaration-block-trailing-semicolon" : "always",
|
||||||
"selector-pseudo-element-colon-notation": "double",
|
"stylistic/declaration-colon-space-after" : "always",
|
||||||
"stylistic/selector-pseudo-class-parentheses-space-inside": "never",
|
"stylistic/number-leading-zero" : "always",
|
||||||
"stylistic/media-feature-range-operator-space-before": "always",
|
"function-url-quotes" : ["always", { "except": ["empty"] }],
|
||||||
"stylistic/media-feature-range-operator-space-after": "always",
|
"function-url-scheme-disallowed-list" : ["data","http"],
|
||||||
"stylistic/media-feature-parentheses-space-inside": "never",
|
"comment-whitespace-inside" : "always",
|
||||||
"stylistic/media-feature-colon-space-before": "always",
|
"stylistic/string-quotes" : "single",
|
||||||
"stylistic/media-feature-colon-space-after": "always",
|
"stylistic/media-feature-range-operator-space-before" : "always",
|
||||||
"naturalcrit/align-colons": true,
|
"stylistic/media-feature-range-operator-space-after" : "always",
|
||||||
"naturalcrit/declaration-block-multi-line-min-declarations" : 1
|
"stylistic/media-feature-parentheses-space-inside" : "never",
|
||||||
|
"stylistic/media-feature-colon-space-before" : "always",
|
||||||
|
"stylistic/media-feature-colon-space-after" : "always",
|
||||||
|
"naturalcrit/declaration-colon-align" : true,
|
||||||
|
"naturalcrit/declaration-block-multi-line-min-declarations": 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ const StringArrayEditor = createClass({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{this.props.notes ? this.props.notes.map((n)=><p><small>{n}</small></p>) : null}
|
{this.props.notes ? this.props.notes.map((n, index)=><p key={index}><small>{n}</small></p>) : null}
|
||||||
</div>
|
</div>
|
||||||
</div>;
|
</div>;
|
||||||
}
|
}
|
||||||
|
|||||||
927
package-lock.json
generated
927
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
14
package.json
14
package.json
@@ -78,10 +78,10 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/core": "^7.21.8",
|
"@babel/core": "^7.22.1",
|
||||||
"@babel/plugin-transform-runtime": "^7.21.4",
|
"@babel/plugin-transform-runtime": "^7.22.2",
|
||||||
"@babel/preset-env": "^7.21.5",
|
"@babel/preset-env": "^7.22.2",
|
||||||
"@babel/preset-react": "^7.18.6",
|
"@babel/preset-react": "^7.22.3",
|
||||||
"@googleapis/drive": "^5.1.0",
|
"@googleapis/drive": "^5.1.0",
|
||||||
"body-parser": "^1.20.2",
|
"body-parser": "^1.20.2",
|
||||||
"classnames": "^2.3.2",
|
"classnames": "^2.3.2",
|
||||||
@@ -101,7 +101,7 @@
|
|||||||
"marked-extended-tables": "^1.0.6",
|
"marked-extended-tables": "^1.0.6",
|
||||||
"markedLegacy": "npm:marked@^0.3.19",
|
"markedLegacy": "npm:marked@^0.3.19",
|
||||||
"moment": "^2.29.4",
|
"moment": "^2.29.4",
|
||||||
"mongoose": "^7.1.2",
|
"mongoose": "^7.2.1",
|
||||||
"nanoid": "3.3.4",
|
"nanoid": "3.3.4",
|
||||||
"nconf": "^0.12.0",
|
"nconf": "^0.12.0",
|
||||||
"npm": "^9.6.7",
|
"npm": "^9.6.7",
|
||||||
@@ -114,7 +114,7 @@
|
|||||||
"vitreum": "git+https://git@github.com/calculuschild/vitreum.git"
|
"vitreum": "git+https://git@github.com/calculuschild/vitreum.git"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "^8.40.0",
|
"eslint": "^8.41.0",
|
||||||
"eslint-plugin-jest": "^27.2.1",
|
"eslint-plugin-jest": "^27.2.1",
|
||||||
"eslint-plugin-react": "^7.32.2",
|
"eslint-plugin-react": "^7.32.2",
|
||||||
"jest": "^29.5.0",
|
"jest": "^29.5.0",
|
||||||
@@ -122,7 +122,7 @@
|
|||||||
"postcss-less": "^6.0.0",
|
"postcss-less": "^6.0.0",
|
||||||
"stylelint": "^15.6.2",
|
"stylelint": "^15.6.2",
|
||||||
"stylelint-config-recess-order": "^4.0.0",
|
"stylelint-config-recess-order": "^4.0.0",
|
||||||
"stylelint-config-standard": "^33.0.0",
|
"stylelint-config-recommended": "^12.0.0",
|
||||||
"stylelint-stylistic": "^0.4.2",
|
"stylelint-stylistic": "^0.4.2",
|
||||||
"supertest": "^6.3.3"
|
"supertest": "^6.3.3"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,7 +138,9 @@ fs.emptyDirSync('./build');
|
|||||||
//In development set up a watch server and livereload
|
//In development set up a watch server and livereload
|
||||||
if(isDev){
|
if(isDev){
|
||||||
livereload('./build');
|
livereload('./build');
|
||||||
watchFile('./server.js', {
|
watchFile('./server.js', { // Rebuild when change detected to this file or any nested directory from here
|
||||||
watch : ['./client', './server', './themes'] // Watch additional folders if you want
|
ignore : ['./build'], // Ignore ./build or it will rebuild again
|
||||||
|
ext : 'less', // Other extensions to watch (only .js/.json/.jsx by default)
|
||||||
|
//watch: ['./client', './server', './themes'], // Watch additional folders if you want
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,11 +97,14 @@ const CodeEditor = createClass({
|
|||||||
this.codeMirror = CodeMirror(this.refs.editor, {
|
this.codeMirror = CodeMirror(this.refs.editor, {
|
||||||
lineNumbers : true,
|
lineNumbers : true,
|
||||||
lineWrapping : this.props.wrap,
|
lineWrapping : this.props.wrap,
|
||||||
indentWithTabs : true,
|
indentWithTabs : false,
|
||||||
tabSize : 2,
|
tabSize : 2,
|
||||||
|
smartIndent : false,
|
||||||
historyEventDelay : 250,
|
historyEventDelay : 250,
|
||||||
scrollPastEnd : true,
|
scrollPastEnd : true,
|
||||||
extraKeys : {
|
extraKeys : {
|
||||||
|
'Tab' : this.indent,
|
||||||
|
'Shift-Tab' : this.dedent,
|
||||||
'Ctrl-B' : this.makeBold,
|
'Ctrl-B' : this.makeBold,
|
||||||
'Cmd-B' : this.makeBold,
|
'Cmd-B' : this.makeBold,
|
||||||
'Ctrl-I' : this.makeItalic,
|
'Ctrl-I' : this.makeItalic,
|
||||||
@@ -171,6 +174,19 @@ const CodeEditor = createClass({
|
|||||||
this.updateSize();
|
this.updateSize();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
indent : function () {
|
||||||
|
const cm = this.codeMirror;
|
||||||
|
if (cm.somethingSelected()) {
|
||||||
|
cm.execCommand('indentMore');
|
||||||
|
} else {
|
||||||
|
cm.execCommand('insertSoftTab');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
dedent : function () {
|
||||||
|
this.codeMirror.execCommand('indentLess');
|
||||||
|
},
|
||||||
|
|
||||||
makeHeader : function (number) {
|
makeHeader : function (number) {
|
||||||
const selection = this.codeMirror.getSelection();
|
const selection = this.codeMirror.getSelection();
|
||||||
const header = Array(number).fill('#').join('');
|
const header = Array(number).fill('#').join('');
|
||||||
|
|||||||
@@ -1,68 +0,0 @@
|
|||||||
const stylelint = require('stylelint');
|
|
||||||
|
|
||||||
const { report, ruleMessages, validateOptions } = stylelint.utils;
|
|
||||||
const ruleName = 'naturalcrit/align-colons';
|
|
||||||
const messages = ruleMessages(ruleName, {
|
|
||||||
expected: (rule) => `Expected colons aligned within rule "${rule}"`,
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
module.exports = stylelint.createPlugin(ruleName, function getPlugin(primaryOption, secondaryOptionObject, context) {
|
|
||||||
return function lint(postcssRoot, postcssResult) {
|
|
||||||
|
|
||||||
const validOptions = validateOptions(
|
|
||||||
postcssResult,
|
|
||||||
ruleName,
|
|
||||||
{
|
|
||||||
actual: primaryOption,
|
|
||||||
possible: [
|
|
||||||
true,
|
|
||||||
false
|
|
||||||
]
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!validOptions) { //If the options are invalid, don't lint
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const isAutoFixing = Boolean(context.fix);
|
|
||||||
postcssRoot.walkRules(rule => { //Iterate CSS rules
|
|
||||||
|
|
||||||
let maxColonPos = 0;
|
|
||||||
let misaligned = false;
|
|
||||||
rule.each(declaration => {
|
|
||||||
|
|
||||||
if(declaration.type != "decl")
|
|
||||||
return;
|
|
||||||
|
|
||||||
let colonPos = declaration.prop.length + declaration.raws.between.indexOf(":");
|
|
||||||
if (maxColonPos > 0 && colonPos != maxColonPos) {
|
|
||||||
misaligned = true;
|
|
||||||
}
|
|
||||||
maxColonPos = Math.max(maxColonPos, colonPos);
|
|
||||||
});
|
|
||||||
|
|
||||||
if(misaligned) {
|
|
||||||
if (isAutoFixing) { //We are in “fix” mode
|
|
||||||
rule.each(declaration => {
|
|
||||||
if(declaration.type != "decl")
|
|
||||||
return;
|
|
||||||
|
|
||||||
declaration.raws.between = " ".repeat(maxColonPos - declaration.prop.length) + ":" + declaration.raws.between.split(":")[1];
|
|
||||||
})
|
|
||||||
} else { //We are in “report only” mode
|
|
||||||
report({
|
|
||||||
ruleName,
|
|
||||||
result: postcssResult,
|
|
||||||
message: messages.expected(rule.selector), // Build the reported message
|
|
||||||
node: rule, // Specify the reported node
|
|
||||||
word: rule.selector, // Which exact word caused the error? This positions the error properly
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
module.exports.ruleName = ruleName;
|
|
||||||
module.exports.messages = messages;
|
|
||||||
@@ -4,50 +4,54 @@ const { isNumber } = require('stylelint/lib/utils/validateTypes');
|
|||||||
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';
|
||||||
const messages = ruleMessages(ruleName, {
|
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`,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
module.exports = stylelint.createPlugin(ruleName, function getPlugin(primaryOption, secondaryOptionObject, context) {
|
module.exports = stylelint.createPlugin(ruleName, function getPlugin(primaryOption, secondaryOptionObject, context) {
|
||||||
return function lint(postcssRoot, postcssResult) {
|
return function lint(postcssRoot, postcssResult) {
|
||||||
|
|
||||||
const validOptions = validateOptions(
|
const validOptions = validateOptions(
|
||||||
postcssResult,
|
postcssResult,
|
||||||
ruleName,
|
ruleName,
|
||||||
{
|
{
|
||||||
actual: primaryOption,
|
actual : primaryOption,
|
||||||
possible: [isNumber],
|
possible : [isNumber],
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
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 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAutoFixing) { //We are in “fix” mode
|
//Ignore if already one line
|
||||||
rule.each((decl) => {
|
if(!rule.nodes.some((node)=>node.raws.before.includes('\n')) && !rule.raws.after.includes('\n'))
|
||||||
decl.raws.before = " ";
|
return;
|
||||||
});
|
|
||||||
rule.raws.after = ' ';
|
if(isAutoFixing) { //We are in “fix” mode
|
||||||
} else {
|
rule.each((decl)=>{
|
||||||
report({
|
decl.raws.before = ' ';
|
||||||
ruleName,
|
});
|
||||||
result: postcssResult,
|
rule.raws.after = ' ';
|
||||||
message: messages.expected(rule.nodes.length), // Build the reported message
|
} else {
|
||||||
node: rule, // Specify the reported node
|
report({
|
||||||
word: rule.selector, // Which exact word caused the error? This positions the error properly
|
ruleName,
|
||||||
});
|
result : postcssResult,
|
||||||
}
|
message : messages.expected(rule.nodes.length), // Build the reported message
|
||||||
});
|
node : rule, // Specify the reported node
|
||||||
};
|
word : rule.selector, // Which exact word caused the error? This positions the error properly
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports.ruleName = ruleName;
|
module.exports.ruleName = ruleName;
|
||||||
|
|||||||
68
stylelint_plugins/declaration-colon-align.js
Normal file
68
stylelint_plugins/declaration-colon-align.js
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
const stylelint = require('stylelint');
|
||||||
|
|
||||||
|
const { report, ruleMessages, validateOptions } = stylelint.utils;
|
||||||
|
const ruleName = 'naturalcrit/declaration-colon-align';
|
||||||
|
const messages = ruleMessages(ruleName, {
|
||||||
|
expected : (rule)=>`Expected colons aligned within rule "${rule}"`,
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
module.exports = stylelint.createPlugin(ruleName, function getPlugin(primaryOption, secondaryOptionObject, context) {
|
||||||
|
return function lint(postcssRoot, postcssResult) {
|
||||||
|
|
||||||
|
const validOptions = validateOptions(
|
||||||
|
postcssResult,
|
||||||
|
ruleName,
|
||||||
|
{
|
||||||
|
actual : primaryOption,
|
||||||
|
possible : [
|
||||||
|
true,
|
||||||
|
false
|
||||||
|
]
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
if(!validOptions) { //If the options are invalid, don't lint
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const isAutoFixing = Boolean(context.fix);
|
||||||
|
postcssRoot.walkRules((rule)=>{ //Iterate CSS rules
|
||||||
|
|
||||||
|
let maxColonPos = 0;
|
||||||
|
let misaligned = false;
|
||||||
|
rule.each((declaration)=>{
|
||||||
|
|
||||||
|
if(declaration.type != 'decl')
|
||||||
|
return;
|
||||||
|
|
||||||
|
const colonPos = declaration.prop.length + declaration.raws.between.indexOf(':');
|
||||||
|
if(maxColonPos > 0 && colonPos != maxColonPos) {
|
||||||
|
misaligned = true;
|
||||||
|
}
|
||||||
|
maxColonPos = Math.max(maxColonPos, colonPos);
|
||||||
|
});
|
||||||
|
|
||||||
|
if(misaligned) {
|
||||||
|
if(isAutoFixing) { //We are in “fix” mode
|
||||||
|
rule.each((declaration)=>{
|
||||||
|
if(declaration.type != 'decl')
|
||||||
|
return;
|
||||||
|
|
||||||
|
declaration.raws.between = `${' '.repeat(maxColonPos - declaration.prop.length)}:${declaration.raws.between.split(':')[1]}`;
|
||||||
|
});
|
||||||
|
} else { //We are in “report only” mode
|
||||||
|
report({
|
||||||
|
ruleName,
|
||||||
|
result : postcssResult,
|
||||||
|
message : messages.expected(rule.selector), // Build the reported message
|
||||||
|
node : rule, // Specify the reported node
|
||||||
|
word : rule.selector, // Which exact word caused the error? This positions the error properly
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports.ruleName = ruleName;
|
||||||
|
module.exports.messages = messages;
|
||||||
@@ -4,48 +4,48 @@ const { isNumber } = require('stylelint/lib/utils/validateTypes');
|
|||||||
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';
|
||||||
const messages = ruleMessages(ruleName, {
|
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 ":"`
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
module.exports = stylelint.createPlugin(ruleName, function getPlugin(primaryOption, secondaryOptionObject, context) {
|
module.exports = stylelint.createPlugin(ruleName, function getPlugin(primaryOption, secondaryOptionObject, context) {
|
||||||
return function lint(postcssRoot, postcssResult) {
|
return function lint(postcssRoot, postcssResult) {
|
||||||
|
|
||||||
const validOptions = validateOptions(
|
const validOptions = validateOptions(
|
||||||
postcssResult,
|
postcssResult,
|
||||||
ruleName,
|
ruleName,
|
||||||
{
|
{
|
||||||
actual: primaryOption,
|
actual : primaryOption,
|
||||||
possible: [isNumber],
|
possible : [isNumber],
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
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.walkDecls(decl => { //Iterate CSS declarations
|
postcssRoot.walkDecls((decl)=>{ //Iterate CSS declarations
|
||||||
|
|
||||||
let 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 {
|
||||||
report({
|
report({
|
||||||
ruleName,
|
ruleName,
|
||||||
result: postcssResult,
|
result : postcssResult,
|
||||||
message: messages.expected(primaryOption), // Build the reported message
|
message : messages.expected(primaryOption), // Build the reported message
|
||||||
node: decl, // Specify the reported node
|
node : decl, // Specify the reported node
|
||||||
word: ":", // Which exact word caused the error? This positions the error properly
|
word : ':', // Which exact word caused the error? This positions the error properly
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports.ruleName = ruleName;
|
module.exports.ruleName = ruleName;
|
||||||
|
|||||||
Reference in New Issue
Block a user