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

Move stylelint config to .stylelintrc.js; add comments #1249

Merged
merged 1 commit into from
Apr 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
38 changes: 38 additions & 0 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/**
* React Starter Kit (https://www.reactstarterkit.com/)
*
* Copyright © 2014-present Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/

// stylelint configuration
// https://stylelint.io/user-guide/configuration/
module.exports = {

// The standard config based on a handful of CSS style guides
// https://github.com/stylelint/stylelint-config-standard
extends: 'stylelint-config-standard',

rules: {
'property-no-unknown': [true, {
ignoreProperties: [
// CSS Modules composition
// https://github.com/css-modules/css-modules#composition
'composes'
]
}],

'selector-pseudo-class-no-unknown': [true, {
ignorePseudoClasses: [
// CSS Modules :global scope
// https://github.com/css-modules/css-modules#exceptions
'global'
]
}],

// Opinionated rule, you can disable it if you want
'string-quotes': 'single',
},
};
22 changes: 0 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,28 +136,6 @@
}
}
},
"stylelint": {
"extends": "stylelint-config-standard",
"rules": {
"string-quotes": "single",
"property-no-unknown": [
true,
{
"ignoreProperties": [
"composes"
]
}
],
"selector-pseudo-class-no-unknown": [
true,
{
"ignorePseudoClasses": [
"global"
]
}
]
}
},
"lint-staged": {
"*.{cmd,html,json,md,sh,txt,xml,yml}": [
"editorconfig-tools fix",
Expand Down
5 changes: 0 additions & 5 deletions src/data/models/.eslintrc

This file was deleted.

9 changes: 0 additions & 9 deletions test/.eslintrc

This file was deleted.

6 changes: 0 additions & 6 deletions tools/.eslintrc

This file was deleted.

2 changes: 1 addition & 1 deletion tools/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function bundle() {
return reject(err);
}

console.log(stats.toString(webpackConfig[0].stats));
console.info(stats.toString(webpackConfig[0].stats));
return resolve();
});
});
Expand Down
2 changes: 1 addition & 1 deletion tools/copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ async function copy() {
}
const end = new Date();
const time = end.getTime() - start.getTime();
console.log(`[${format(end)}] ${event} '${dist}' after ${time} ms`);
console.info(`[${format(end)}] ${event} '${dist}' after ${time} ms`);
});
}
}
Expand Down
4 changes: 2 additions & 2 deletions tools/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async function deploy() {
// generates optimized and minimized bundles
process.argv.push('--release');
if (remote.static) process.argv.push('--static');
await run(require('./build').default);
await run(require('./build').default); // eslint-disable-line global-require
if (process.argv.includes('--static')) {
await cleanDir('build/*', {
nosort: true,
Expand All @@ -100,7 +100,7 @@ async function deploy() {

// Check if the site was successfully deployed
const response = await fetch(remote.website);
console.log(`${remote.website} => ${response.status} ${response.statusText}`);
console.info(`${remote.website} => ${response.status} ${response.statusText}`);
}

export default deploy;
2 changes: 2 additions & 0 deletions tools/postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
* LICENSE.txt file in the root directory of this source tree.
*/

/* eslint-disable global-require */

module.exports = () => ({
// The list of plugins for PostCSS
// https://github.com/postcss/postcss
Expand Down
2 changes: 1 addition & 1 deletion tools/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async function render() {
await makeDir(dirName);
await writeFile(dist, text);
const time = timeEnd.getTime() - timeStart.getTime();
console.log(`#${index + 1} ${dist} => ${response.status} ${response.statusText} (${time} ms)`);
console.info(`#${index + 1} ${dist} => ${response.status} ${response.statusText} (${time} ms)`);
}));

server.kill('SIGTERM');
Expand Down
17 changes: 12 additions & 5 deletions tools/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,30 @@ export function format(time) {
function run(fn, options) {
const task = typeof fn.default === 'undefined' ? fn : fn.default;
const start = new Date();
console.log(
console.info(
`[${format(start)}] Starting '${task.name}${options ? ` (${options})` : ''}'...`,
);
return task(options).then((resolution) => {
const end = new Date();
const time = end.getTime() - start.getTime();
console.log(
console.info(
`[${format(end)}] Finished '${task.name}${options ? ` (${options})` : ''}' after ${time} ms`,
);
return resolution;
});
}

if (require.main === module && process.argv.length > 2) {
delete require.cache[__filename]; // eslint-disable-line no-underscore-dangle
const module = require(`./${process.argv[2]}.js`).default; // eslint-disable-line import/no-dynamic-require
run(module).catch((err) => { console.error(err.stack); process.exit(1); });
// eslint-disable-next-line no-underscore-dangle
delete require.cache[__filename];

// eslint-disable-next-line global-require, import/no-dynamic-require
const module = require(`./${process.argv[2]}.js`).default;

run(module).catch((err) => {
console.error(err.stack);
process.exit(1);
});
}

export default run;