Eli Perelman
8 years ago
committed by
GitHub
13 changed files with 706 additions and 131 deletions
@ -1,50 +1,78 @@ |
|||
module.exports = { |
|||
ecmaVersion: 2017, |
|||
const Neutrino = require('./packages/neutrino'); |
|||
const airbnb = require('./packages/neutrino-preset-airbnb-base'); |
|||
|
|||
// http://eslint.org/docs/user-guide/configuring#specifying-parser-options
|
|||
ecmaFeatures: { |
|||
modules: true, |
|||
decorators: true, |
|||
experimentalObjectRestSpread: true, |
|||
}, |
|||
const api = new Neutrino(); |
|||
|
|||
env: { |
|||
api.use(airbnb, { |
|||
eslint: { |
|||
node: true, |
|||
browser: true, |
|||
es6: true, |
|||
worker: true, |
|||
serviceworker: true, |
|||
}, |
|||
|
|||
plugins: [ |
|||
'eslint-plugin-prettier', |
|||
], |
|||
|
|||
rules: { |
|||
// Specify the maximum length of a line in your program
|
|||
// JSX can get lengthy, so this helps alleviate that a bit
|
|||
// http://eslint.org/docs/rules/max-len
|
|||
'max-len': ['error', 120, 2, { |
|||
ignoreUrls: true, |
|||
ignoreComments: false, |
|||
ignoreStrings: true, |
|||
ignoreTemplateLiterals: true |
|||
}], |
|||
|
|||
// Allow using class methods with static/non-instance functionality
|
|||
// React lifecycle methods commonly do not use an instance context for anything
|
|||
'class-methods-use-this': 'off', |
|||
|
|||
// Disallow trailing commas on arrays, objects, functions, et al
|
|||
'comma-dangle': ['error', 'never'], |
|||
|
|||
// Allow console during development, otherwise throw an error
|
|||
'no-console': 'warn', |
|||
|
|||
// Allow extra parentheses since multiline JSX being wrapped in parens is considered idiomatic
|
|||
'no-extra-parens': 'off', |
|||
|
|||
// Our frontend strives to adopt functional programming practices, so we prefer const over let
|
|||
'prefer-const': 'error', |
|||
plugins: ['eslint-plugin-prettier'], |
|||
rules: { |
|||
// Disable necessitating return after a callback
|
|||
'callback-return': 'off', |
|||
|
|||
// Allow using class methods with static/non-instance functionality
|
|||
// React lifecycle methods commonly do not use an instance context for anything
|
|||
'class-methods-use-this': 'off', |
|||
|
|||
// Disallow trailing commas on arrays, objects, functions, et al
|
|||
'comma-dangle': ['error', 'never'], |
|||
|
|||
// Require all requires be top-level
|
|||
// http://eslint.org/docs/rules/global-require
|
|||
'global-require': 'error', |
|||
|
|||
// Enforces error handling in callbacks (node environment)
|
|||
'handle-callback-err': 'off', |
|||
|
|||
// Allow dynamic requires
|
|||
'import/no-dynamic-require': 'off', |
|||
|
|||
// Specify the maximum length of a line in your program
|
|||
// JSX can get lengthy, so this helps alleviate that a bit
|
|||
// http://eslint.org/docs/rules/max-len
|
|||
'max-len': ['error', 120, 2, { |
|||
ignoreUrls: true, |
|||
ignoreComments: false, |
|||
ignoreStrings: true, |
|||
ignoreTemplateLiterals: true |
|||
}], |
|||
|
|||
// Allow console during development, otherwise throw an error
|
|||
'no-console': 'warn', |
|||
|
|||
// Allow extra parentheses since multiline JSX being wrapped in parens is considered idiomatic
|
|||
'no-extra-parens': 'off', |
|||
|
|||
// Disallow mixing regular variable and require declarations
|
|||
'no-mixed-requires': ['off', false], |
|||
|
|||
// Disallow use of new operator with the require function
|
|||
'no-new-require': 'error', |
|||
|
|||
// Disallow string concatenation with __dirname and __filename
|
|||
// http://eslint.org/docs/rules/no-path-concat
|
|||
'no-path-concat': 'error', |
|||
|
|||
// Allow use of process.env
|
|||
'no-process-env': 'off', |
|||
|
|||
// Allow process.exit()
|
|||
'no-process-exit': 'off', |
|||
|
|||
// Restrict usage of specified node modules
|
|||
'no-restricted-modules': 'off', |
|||
|
|||
// Allowing shadowing variable that share the same context as the outer scope
|
|||
'no-shadow': 'off', |
|||
|
|||
// Allow use of synchronous methods (off by default)
|
|||
'no-sync': 'off', |
|||
|
|||
// Our frontend strives to adopt functional programming practices, so we prefer const over let
|
|||
'prefer-const': 'error', |
|||
} |
|||
} |
|||
} |
|||
}); |
|||
|
|||
module.exports = api.eslintrc(); |
|||
|
@ -1,5 +1,8 @@ |
|||
module.exports = ({ config }) => config.module |
|||
.rule('style') |
|||
.test(/\.css$/) |
|||
.use('style').loader(require.resolve('style-loader')).end() |
|||
.use('css').loader(require.resolve('css-loader')); |
|||
.use('style') |
|||
.loader(require.resolve('style-loader')) |
|||
.end() |
|||
.use('css') |
|||
.loader(require.resolve('css-loader')); |
|||
|
File diff suppressed because it is too large
Loading…
Reference in new issue