forked from microsoft/FluidFramework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
50 lines (48 loc) · 1.34 KB
/
.eslintrc.cjs
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
/*!
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
* Licensed under the MIT License.
*/
module.exports = {
extends: [require.resolve("@fluidframework/eslint-config-fluid/strict"), "prettier"],
parserOptions: {
project: ["./tsconfig.json", "./src/test/tsconfig.json"],
},
rules: {
// Useful for developer accessibility
"unicorn/prevent-abbreviations": [
"error",
{
// Exact variable name checks.
// See: https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prevent-abbreviations.md#allowlist
allowList: {
// Industry-standard index variable name.
i: true,
},
// RegEx-based exclusions
// See: https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prevent-abbreviations.md#ignore
ignore: [
// "props" has become something of an industry standard abbreviation for "properties".
// Allow names to include "props" / "Props".
"[pP]rops",
],
},
],
},
overrides: [
{
// Overrides for type-tests
files: ["src/test/types/*"],
rules: {
"unicorn/prevent-abbreviations": "off",
},
},
{
// Overrides for tests
files: ["src/test/*.spec.ts"],
rules: {
// Mocha tests should prefer regular functions, see https://mochajs.org/#arrow-functions
"prefer-arrow-callback": "off",
},
},
],
};