Skip to content

Commit

Permalink
3.3.0: Add vue support
Browse files Browse the repository at this point in the history
  • Loading branch information
foray1010 committed Feb 1, 2017
1 parent e33b321 commit 52f1b96
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 19 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "eslint-config-aftership",
"description": "AfterShip ESLint config (modified from Airbnb)",
"version": "3.2.1",
"version": "3.3.0",
"homepage": "https://github.com/AfterShip/eslint-config-aftership",
"author": {
"name": "AfterShip",
Expand All @@ -28,6 +28,7 @@
"babel-eslint": "^7.1.1",
"eslint": "^3.12.1",
"eslint-plugin-babel": "^3.3.0",
"eslint-plugin-html": "^2.0.0",
"eslint-plugin-import": "^2.1.0",
"eslint-plugin-jsx-a11y": "^2.2.3",
"eslint-plugin-react": "^6.6.0"
Expand All @@ -37,6 +38,7 @@
"eslint": "^3.12.1",
"eslint-config-airbnb": "13.0.0",
"eslint-plugin-babel": "^3.3.0",
"eslint-plugin-html": "^2.0.0",
"eslint-plugin-import": "^2.1.0",
"eslint-plugin-jsx-a11y": "^2.2.3",
"eslint-plugin-react": "^6.6.0",
Expand Down
19 changes: 1 addition & 18 deletions react.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module.exports = extendConfig({
extends: [
'eslint-config-airbnb',
'eslint-config-aftership/rules/main',
'eslint-config-aftership/rules/frontend',
'eslint-config-aftership/rules/camelcase'
],
parserOptions: {
Expand All @@ -14,25 +15,7 @@ module.exports = extendConfig({
jsx: true
}
},
env: {
commonjs: true,
node: false,
webextensions: true
},
globals: {
console: false, // for console.log
process: false, // for process.env.NODE_ENV
window: false
},
rules: {
// we alias some local folders to modules, for example `project-root/src/app` => `app`
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/imports-first.md
'import/imports-first': 'off',

// it fails with inject-loader
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md
'import/no-unresolved': 'off',

// for array, sometime it is not all the same type
// for object, it is very painful to define the object structure every time
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-prop-types.md
Expand Down
31 changes: 31 additions & 0 deletions rules/frontend.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
'use strict';

module.exports = {
env: {
commonjs: true,
node: false,
webextensions: true
},
plugins: [
'html'
],
settings: {
'html/indent': 'tab',
'html/report-bad-indent': 'error'
},
globals: {
console: false, // for console.log
document: false,
process: false, // for process.env.NODE_ENV
window: false
},
rules: {
// we alias some local folders to modules, for example `project-root/src/app` => `app`
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/imports-first.md
'import/imports-first': 'off',

// it fails with inject-loader
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md
'import/no-unresolved': 'off'
}
};
30 changes: 30 additions & 0 deletions vue.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
'use strict';

const extendConfig = require('./lib/extend_config');

module.exports = extendConfig({
extends: [
'eslint-config-airbnb/base',
'eslint-config-aftership/rules/main',
'eslint-config-aftership/rules/frontend',
'eslint-config-aftership/rules/camelcase'
],
parserOptions: {
ecmaFeatures: {
experimentalObjectRestSpread: true
}
},
settings: {
'import/extensions': ['.js', '.vue'],
'import/resolver': {
node: {
extensions: ['.js', '.vue', '.json']
}
}
},
rules: {
// this two doesn't work in vue
'import/no-named-as-default': 'off',
'import/no-named-as-default-member': 'off'
}
});

0 comments on commit 52f1b96

Please sign in to comment.