mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 14:13:37 +08:00
chore: update .eslintrc.js
This commit is contained in:
parent
d75c0d0b24
commit
af07139d62
57
.eslintrc.js
Normal file
57
.eslintrc.js
Normal file
@ -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;
|
@ -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
|
||||
}
|
||||
}
|
@ -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…
Reference in New Issue
Block a user