forked from neutrinojs/neutrino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.neutrinorc.js
86 lines (84 loc) · 2.81 KB
/
.neutrinorc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
const airbnb = require('./packages/airbnb');
module.exports = {
options: {
root: __dirname,
},
use: [
airbnb({
// See the package.json `lint` script for which files are linted.
// Excludes are managed via `.eslintignore`.
eslint: {
baseConfig: {
extends: ['plugin:prettier/recommended'],
env: {
browser: true,
jest: true,
mocha: true,
node: true,
},
rules: {
'prettier/prettier': [
'error',
{
singleQuote: true,
bracketSameLine: true,
trailingComma: 'all',
proseWrap: 'always',
},
],
// Allow using console since most of the code in this repo isn't run in a browser.
'no-console': 'off',
// Allowing shadowing variable that share the same context as the outer scope
'no-shadow': 'off',
},
overrides: [
{
files: [
'packages/create-project/commands/init/templates/**',
'packages/create-project/commands/init/templates/*/.*.js',
],
rules: {
// The dependencies in create-project's templates are installed by
// by create-project and so are expected to be missing from package.json.
'import/no-extraneous-dependencies': 'off',
},
},
{
files: [
'packages/create-project/commands/init/templates/preact/**',
],
settings: {
react: {
pragma: 'h',
},
},
rules: {
// With Preact the use of `class` is recommended over `className`,
// so we have to add `class` to the ignore list, to prevent:
// `Unknown property 'class' found, use 'className' instead`
'react/no-unknown-property': ['error', { ignore: ['class'] }],
},
},
{
files: ['packages/*/test/*'],
rules: {
// The tests need to do non-global require() to test the presets.
'global-require': 'off',
// This rule doesn't handle devDependencies being defined
// in the monorepo root package.json.
'import/no-extraneous-dependencies': 'off',
},
},
],
},
},
}),
(neutrino) => {
neutrino.register('prettierrc', (neutrino) => {
const handler = neutrino.outputHandlers.get('eslintrc');
const eslintConfig = handler(neutrino);
return eslintConfig.rules['prettier/prettier'][1];
});
},
],
};