Browse Source

chore: update .eslintrc.js

pull/1313/head
Benjy Cui 9 years ago
parent
commit
af07139d62
  1. 57
      .eslintrc.js
  2. 39
      .eslintrc.json
  3. 6
      package.json

57
.eslintrc.js

@ -0,0 +1,57 @@
'use strict';
const eslintrc = {
extends: ['eslint-config-airbnb'],
env: {
browser: true,
node: true,
mocha: true,
jest: true,
es6: true,
},
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 6,
ecmaFeatures: {
jsx: true,
experimentalObjectRestSpread: true,
},
},
plugins: [
'markdown',
'react',
'babel',
],
rules: {
'comma-dangle': 0,
'func-names': 0,
'prefer-const': 0,
'arrow-body-style': 0,
'react/sort-comp': 0,
'react/no-multi-comp': 0,
'react/prop-types': 0,
'react/prefer-es6-class': 0,
'react/prefer-stateless-function': 0,
'react/jsx-closing-bracket-location': 0,
'no-param-reassign': 0,
'no-return-assign': 0,
'max-len': 0,
'consistent-return': 0,
}
};
if (process.env.ANTD === 'DEMO') {
eslintrc.globals = {
React: true,
ReactDOM: true,
mountNode: true,
};
Object.assign(eslintrc.rules, {
'no-console': 0,
'eol-last': 0,
'prefer-rest-params': 0,
});
}
module.exports = eslintrc;

39
.eslintrc.json

@ -1,39 +0,0 @@
{
"parser": "babel-eslint",
"extends": ["eslint-config-airbnb"],
"env": {
"browser": true,
"node": true,
"mocha": true,
"jest": true,
"es6": true
},
"parserOptions": {
"ecmaVersion": 6,
"ecmaFeatures": {
"jsx": true,
"experimentalObjectRestSpread": true
}
},
"plugins": [
"markdown",
"react",
"babel"
],
"rules": {
"comma-dangle": 0,
"func-names": 0,
"prefer-const": 0,
"arrow-body-style": 0,
"react/sort-comp": 0,
"react/no-multi-comp": 0,
"react/prop-types": 0,
"react/prefer-es6-class": 0,
"react/prefer-stateless-function": 0,
"react/jsx-closing-bracket-location": 0,
"no-param-reassign": 0,
"no-return-assign": 0,
"max-len": 0,
"consistent-return": 0
}
}

6
package.json

@ -147,9 +147,9 @@
"site": "npm run clean-build && ANTD=WEBSITE atool-build -o ./_site && npm run copy-html && ANTD=PRODUCTION atool-build && cp -R dist _site/dist",
"deploy": "rm -rf node_modules && node scripts/install.js && npm run just-deploy",
"just-deploy": "npm run site && node scripts/deploy.js",
"lint": "npm run srclint && npm run mdlint && npm run lesshint",
"srclint": "eslint components test site index.js --ext '.js,.jsx'",
"mdlint": "eslint components/*/demo/*.md --ext '.md' --global 'React,ReactDOM,mountNode' --rule 'no-console: 0, eol-last: 0, prefer-rest-params: 0'",
"lint": "npm run srclint && npm run demolint && npm run lesshint",
"srclint": "ANTD=SRC eslint components test site index.js --ext '.js,.jsx'",
"demolint": "ANTD=DEMO eslint components/*/demo/*.md --ext '.md'",
"lesshint": "lesshint style/ -e 'style/+(core|mixins)/+(base|iconfont|normalize|layouts|compatibility|grid).less'",
"eslint-fix": "eslint --fix components test site index.js --ext '.js,.jsx' && eslint-tinker ./components/*/demo/*.md",
"test": "npm run lint && atool-build && npm run jest",

Loading…
Cancel
Save