Eli Perelman
8 years ago
13 changed files with 706 additions and 131 deletions
@ -1,50 +1,78 @@ |
|||||
module.exports = { |
const Neutrino = require('./packages/neutrino'); |
||||
ecmaVersion: 2017, |
const airbnb = require('./packages/neutrino-preset-airbnb-base'); |
||||
|
|
||||
// http://eslint.org/docs/user-guide/configuring#specifying-parser-options
|
const api = new Neutrino(); |
||||
ecmaFeatures: { |
|
||||
modules: true, |
|
||||
decorators: true, |
|
||||
experimentalObjectRestSpread: true, |
|
||||
}, |
|
||||
|
|
||||
env: { |
api.use(airbnb, { |
||||
|
eslint: { |
||||
node: true, |
node: true, |
||||
browser: true, |
plugins: ['eslint-plugin-prettier'], |
||||
es6: true, |
rules: { |
||||
worker: true, |
// Disable necessitating return after a callback
|
||||
serviceworker: true, |
'callback-return': 'off', |
||||
}, |
|
||||
|
// Allow using class methods with static/non-instance functionality
|
||||
plugins: [ |
// React lifecycle methods commonly do not use an instance context for anything
|
||||
'eslint-plugin-prettier', |
'class-methods-use-this': 'off', |
||||
], |
|
||||
|
// Disallow trailing commas on arrays, objects, functions, et al
|
||||
rules: { |
'comma-dangle': ['error', 'never'], |
||||
// Specify the maximum length of a line in your program
|
|
||||
// JSX can get lengthy, so this helps alleviate that a bit
|
// Require all requires be top-level
|
||||
// http://eslint.org/docs/rules/max-len
|
// http://eslint.org/docs/rules/global-require
|
||||
'max-len': ['error', 120, 2, { |
'global-require': 'error', |
||||
ignoreUrls: true, |
|
||||
ignoreComments: false, |
// Enforces error handling in callbacks (node environment)
|
||||
ignoreStrings: true, |
'handle-callback-err': 'off', |
||||
ignoreTemplateLiterals: true |
|
||||
}], |
// Allow dynamic requires
|
||||
|
'import/no-dynamic-require': 'off', |
||||
// Allow using class methods with static/non-instance functionality
|
|
||||
// React lifecycle methods commonly do not use an instance context for anything
|
// Specify the maximum length of a line in your program
|
||||
'class-methods-use-this': 'off', |
// JSX can get lengthy, so this helps alleviate that a bit
|
||||
|
// http://eslint.org/docs/rules/max-len
|
||||
// Disallow trailing commas on arrays, objects, functions, et al
|
'max-len': ['error', 120, 2, { |
||||
'comma-dangle': ['error', 'never'], |
ignoreUrls: true, |
||||
|
ignoreComments: false, |
||||
// Allow console during development, otherwise throw an error
|
ignoreStrings: true, |
||||
'no-console': 'warn', |
ignoreTemplateLiterals: true |
||||
|
}], |
||||
// Allow extra parentheses since multiline JSX being wrapped in parens is considered idiomatic
|
|
||||
'no-extra-parens': 'off', |
// Allow console during development, otherwise throw an error
|
||||
|
'no-console': 'warn', |
||||
// Our frontend strives to adopt functional programming practices, so we prefer const over let
|
|
||||
'prefer-const': 'error', |
// 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 |
module.exports = ({ config }) => config.module |
||||
.rule('style') |
.rule('style') |
||||
.test(/\.css$/) |
.test(/\.css$/) |
||||
.use('style').loader(require.resolve('style-loader')).end() |
.use('style') |
||||
.use('css').loader(require.resolve('css-loader')); |
.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