Skip to content

Commit

Permalink
chore: Fix eslint error
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongzhi107 committed Jun 14, 2019
1 parent 7fff800 commit 72e7f21
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 10 deletions.
5 changes: 5 additions & 0 deletions examples/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
rules: {
'import/no-unresolved': [2, { ignore: ['react', 'dace'] }]
}
};
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
"release:alpha": "standard-version --prerelease alpha && npm publish --tag=next",
"dist-tag": "npm dist-tag add [email protected] latest && npm dist-tag add [email protected] next",
"release:major:alpha": "standard-version --release-as major --prerelease alpha && npm publish",
"test": "node test/index.js",
"test": "npm run lint && node test/index.js",
"test:debug": "DEBUG=true node test/index.js",
"pretest": "npm run build"
"pretest": "npm run build",
"lint": "eslint \"test/cases/*.js\" \"src/**/*.js\" \"examples/**/*.js\"",
"lint:fix": "eslint --fix --quiet \"test/cases/*.js\" \"src/**/*.js\" \"examples/**/*.js\""
},
"bin": {
"dace": "./dist/bin/dace.js"
Expand Down
5 changes: 5 additions & 0 deletions src/runtime/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
rules: {
'import/no-unresolved': [2, { ignore: ['react'] }]
}
};
4 changes: 2 additions & 2 deletions src/runtime/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ export default class App extends Component {
}

componentDidUpdate(prevProps) {
if (process.env.DACE_SCROLL_TO_TOP === 'true' &&
this.props.location !== prevProps.location) {
if (process.env.DACE_SCROLL_TO_TOP === 'true'
&& this.props.location !== prevProps.location) {
window.scrollTo(0, 0);
}
}
Expand Down
1 change: 0 additions & 1 deletion src/runtime/createServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ server
const state = serialize(initialProps);
const html = document({
head,
// cssTags,
markup,
state,
styleTags,
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if (module.hot) {
module.hot.accept('./server', () => {
console.log('🔁 HMR Reloading `./server`...');
server.removeListener('request', currentApp);
const newApp = require('./server');
const newApp = require('./server'); // eslint-disable-line
server.on('request', newApp);
currentApp = newApp;
});
Expand Down
2 changes: 1 addition & 1 deletion src/utils/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* DACE_PATH_PROFILES: `profiles` 目录的绝对路径位置
*/
import fs from 'fs';
import logger from '../utils/logger';
import logger from './logger';
import defaultEnv from './defaultEnv';
import resolveApp from './resolveApp';

Expand Down
3 changes: 1 addition & 2 deletions src/utils/stylelintFormatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ function getMessageWidth(widths) {
return widths[3];
}

const availableWidth =
process.stdout.columns < 80 ? 80 : process.stdout.columns;
const availableWidth = process.stdout.columns < 80 ? 80 : process.stdout.columns;
const fullWidth = _.sum(_.values(columnWidths));

// If there is no reason to wrap the text, we won't align the last column to the right
Expand Down
1 change: 0 additions & 1 deletion test/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
module.exports = {
extends: ['eslint-config-qunar'].map(require.resolve),
rules: {
'object-curly-newline': 0,
'func-names': 0,
Expand Down

0 comments on commit 72e7f21

Please sign in to comment.