Changes to configs

pull/13165/head
rubenmoya 7 years ago
parent 9ad73f1d1f
commit ab4f2d06f6

@ -7,6 +7,7 @@
"app/assets/stylesheets/old_common/**/*.css.scss",
"app/assets/stylesheets/table/table_panel/layer-views-panels/filters_panel.css.scss",
"app/assets/stylesheets/editor-3/codemirror.css.scss",
"app/assets/stylesheets/editor-3/_codemirror.scss",
"app/assets/stylesheets/editor-3/form-tags.css.scss"
],
"rules": {

@ -146,7 +146,7 @@
"scripts": {
"test": "grunt test",
"lint": "eslint .",
"lint:css": "stylelint ./app/assets/stylesheets/**/*.css.scss",
"lint:css": "stylelint ./app/assets/stylesheets/**/*.scss",
"lint:fix": "eslint . --fix",
"postversion": "git push origin master --follow-tags",
"update-internal-deps": "rm -rf node_modules && npm install --production --no-optional --no-shrinkwrap && npm dedupe && npm prune && npm shrinkwrap && npm run fix-shrinkwrap-protocol && npm install",

@ -0,0 +1,56 @@
const { resolve } = require('path');
const IGNORED_FILES = [
'app/assets/stylesheets/old_common/**/*.css.scss',
'app/assets/stylesheets/table/table_panel/layer-views-panels/filters_panel.css.scss',
'app/assets/stylesheets/editor-3/codemirror.css.scss',
'app/assets/stylesheets/editor-3/form-tags.css.scss'
];
const getChangedCSSFiles = () => {
const str = require('child_process').execSync('(git diff --name-only --relative || true;' +
'git diff origin/master.. --name-only --relative || true;)' +
'| grep \'\\.scss\\?$\' || true').toString();
const files = str.split(/(\r?\n)/g)
.filter(line => !(line === '\n' || line === '\r' || line.length < 1));
return files.map(f => resolve(__dirname, f));
};
const getAllCSSFiles = () => {
const str = require('child_process')
.execSync('find ./app/assets/stylesheets | grep \'\\.scss\\?$\'')
.toString();
const files = str.split(/(\r?\n)/g)
.filter(line => !(line === '\n' || line === '\r' || line.length < 1));
return files.map(f => resolve(__dirname, f));
};
const changed = getChangedCSSFiles();
const all = getAllCSSFiles();
const toLint = all.filter((file) => !changed.includes(file));
module.exports = {
extends: [
'stylelint-config-standard',
'stylelint-config-property-sort-order-smacss'
],
ignoreFiles: IGNORED_FILES.concat(toLint),
rules: {
'selector-pseudo-element-colon-notation': 'double',
'color-hex-case': 'upper',
'at-rule-no-unknown': [true, {
ignoreAtRules: ['extend', 'at-root', 'debug', 'warn', 'error', 'if', 'else', 'for', 'each', 'while', 'mixin', 'include', 'content', 'return', 'function'
]}
],
'function-name-case': [ 'lower', {
ignoreFunctions: ['/^DXImageTransform.Microsoft.*$/']
}],
'declaration-empty-line-before': null,
'block-no-empty': true,
'shorthand-property-no-redundant-values': true
}
};
Loading…
Cancel
Save