Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Carlino committed Nov 6, 2017
1 parent 64194fa commit 1519004
Show file tree
Hide file tree
Showing 3 changed files with 169 additions and 0 deletions.
125 changes: 125 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
// turn these back on progressively
const todo = {
'react/jsx-filename-extension': [
// most disruptive with the file renames
'off'
],
'react/require-default-props': [
// very useful for future development and generating test/storybook mocks
'off'
],
'react/prop-types': [
// useful for getting a clear indication of a component's signature
'off',
{
// shouldn't need to define children, also ineffective to use `PropTypes.node` as it still fails for stateless components
ignore: ['children']
}
],
'comma-dangle': [
'off'
],
'arrow-parens': [
'off'
],
'indent': [
'off'
],
'react/no-find-dom-node': [
// can use refs instead
'off',
],
};

module.exports = {
'extends': 'airbnb',
'env': {
'jasmine': true
},
'rules': Object.assign({},
todo,
{
// turned off because the PHP side returns dangling properties which trigger this...
// could revise later and add exceptions for PHP data
'no-underscore-dangle': [
'off',
{
'allow': [
'_t'
],
'allowAfterThis': true
}
],
'no-unused-vars': [
'error',
{
'vars': 'local'
}
],
// increased to error because it's strongly discouraged
'react/no-danger': [
'error'
],
'no-plusplus': [
'error',
{
'allowForLoopAfterthoughts': true
}
],
'react/no-unused-prop-types': [
// we want to capture prop types that aren't used
'error'
],
// May revise this when as we get more cleanup done
'react/forbid-prop-types': [
'off'
],
'import/prefer-default-export': [
'off'
],
'import/first': [
'off'
],
'class-methods-use-this': [
'off'
],
// this one makes no sense in some regex contexts
'no-useless-escape': [
'off'
],
// these accessibility rules will be a detriment to existing code/styles,
// perhaps in the future
'jsx-a11y/href-no-hash': [
'off'
],
'jsx-a11y/iframe-has-title': [
'off'
],
'jsx-a11y/anchor-has-content': [
'off'
],
}),
'settings': {
'import/extensions': [
'.js',
'.jsx'
],
'import/resolver': {
'node': {
'extensions': [
'.js',
'.jsx'
],
'moduleDirectory': [
'.',
'client/src',
'../admin/client/src',
'../admin/node_modules',
'vendor/silverstripe/admin/client/src',
'vendor/silverstripe/admin/node_modules',
'node_modules'
]
}
}
}
};
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const config = require('./.eslintrc');

export default config;
41 changes: 41 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "@silverstripe/eslint-config",
"version": "0.0.1",
"description": "SilverStripe config files for eslint",
"engines": {
"node": ">= 6.x"
},
"bin": {
"eslint": "./node_modules/.bin/eslint"
},
"main": "index.js",
"repository": {
"type": "git",
"url": "git://github.com/silverstripe/eslint-config.git"
},
"keywords": [
"silverstripe",
"eslint",
"config",
"modules",
"react"
],
"author": "SilverStripe Ltd",
"license": "BSD-3-Clause",
"bugs": {
"url": "https://github.com/silverstripe/eslint-config/issues"
},
"homepage": "https://github.com/silverstripe/eslint-config",
"dependencies": {
"eslint": "^4.6.1",
"eslint-config-airbnb": "^15.1.0",
"eslint-config-airbnb-base": "^12.0.0",
"eslint-loader": "^1.7.1",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-jsx-a11y": "^5.1.1",
"eslint-plugin-react": "^7.3.0"
},
"resolutions": {
"eslint": "^4.6.1"
}
}

0 comments on commit 1519004

Please sign in to comment.