forked from ledgersmb/LedgerSMB
/
.eslintrc
97 lines (95 loc) · 4.01 KB
/
.eslintrc
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
87
88
89
90
91
92
93
94
95
96
97
{
"settings": {
"import/resolver": {
"node": {
"paths": ["UI"]
}
}
},
"plugins": [
"amd",
"sort-dojo-dependency",
"prettier"
],
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
},
"templateSettings": {
"evaluate": ["[%", "%]"],
"interpolate": ["[%", "%]"],
"escape": ["[%", "%]"]
}
},
"env": {
"browser": true,
// TODO: Can environments be specified in an eslint comment?
// TODO: Can global variable names be specified in an eslint comment?
"node": true,
"amd": true,
"es6": true
},
"extends": [
"airbnb-base/legacy", "prettier",
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings"
],
"ignorePatterns": ["dojo/", "dijit/", "node_modules/", "js/"],
"rules": {
"camelcase": "error",
"consistent-return": "error",
"curly": ["error", "all"], // Keep braces
"dot-notation": "error",
"eqeqeq": "error",
"func-names": 0, // Dojo define pattern uses unnamed functions
"global-require": "error",
"guard-for-in": "error",
"new-cap": 0, // Allow constructor name to start with a lowercase letter
"no-alert": "error",
"no-console": "error",
"no-continue": 0, // Disable to avoid confusion with .continue dojo function
"no-else-return": "error",
"no-lonely-if": "error",
"no-multi-assign": "error",
"no-multi-spaces": "error",
"no-new-object": "error",
"no-param-reassign": "error",
"no-plusplus": 0, // Don't disable unary operator '++'
"no-restricted-globals": "error",
"no-shadow": "error",
"no-template-curly-in-string": "error",
"no-undef": "error",
"no-underscore-dangle": 0, // Allow underscores in identifiers
"no-unused-expressions": "error",
"no-unused-vars": "error",
"no-use-before-define": "error",
"no-useless-escape": "error",
"no-useless-return": "error",
"one-var": "error",
"radix": "error",
"spaced-comment": ["error", "always", { "block": { "balanced": true } }],
"vars-on-top": 0, // Allow variable definition close to usage
"yoda": "error",
//"object-curly-spacing": ["error", "always"],
"amd/no-unused-dependencies": "error",
"amd/obsolete-dependencies": "error",
"amd/sane-dependency-names": "error",
"prettier/prettier": ["error", {
"bracketSpacing": true, // Print spaces between brackets in object literals.
"printWidth": 80, // Limit to 80 columns
"quote-props": ["error", "consistent"], // If at least one property in an object requires quotes, quote all properties.
"semi": true, // Add a semicolon at the end of every statement.
"singleQuote": false, // Use double quotes
"tabWidth": 4, // Tabs width is 4 spaces
"trailingComma": "none",// No trailing commas
"useTabs": false, // Indent lines with tabs instead of spaces.
"insertPragma": true, // Prettier can insert a special @format marker at the top of files specifying that the file has been formatted with prettier.
"proseWrap": "preserve" // Prettier will wrap markdown text as-is since some services use a linebreak-sensitive renderer
}],
"no-restricted-syntax": ["error", "SequenceExpression"]
}
}