forked from fontsource/fontsource
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
49 lines (48 loc) · 1.74 KB
/
.eslintrc.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
const path = require("path");
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 2021,
project: path.join(__dirname, "./scripts/tsconfig.json"),
},
env: {
commonjs: true,
es2021: true,
node: true,
jest: true,
},
plugins: ["@typescript-eslint", "jest", "promise", "unicorn"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"airbnb-base",
"airbnb-typescript/base",
"plugin:promise/recommended",
"plugin:unicorn/recommended",
"plugin:jest/recommended",
"plugin:prettier/recommended",
],
rules: {
"prettier/prettier": "warn",
// Too restrictive, writing ugly code to defend against a very unlikely scenario: https://eslint.org/docs/rules/no-prototype-builtins
"no-prototype-builtins": "off",
// Not needed to restrict for Fontsource build scripts
"no-console": "off",
// https://basarat.gitbooks.io/typescript/docs/tips/defaultIsBad.html
"import/prefer-default-export": "off",
"import/no-default-export": "error",
// Allow most functions to rely on type inference. If the function is exported, then `@typescript-eslint/explicit-module-boundary-types` will ensure it's typed.
"@typescript-eslint/explicit-function-return-type": "off",
// Only supported in Node 16.x and up
"unicorn/prefer-node-protocol": "off",
// Common abbreviations are known and readable
"unicorn/prevent-abbreviations": "off",
// Airbnb prefers forEach
"unicorn/no-array-for-each": "off",
// It's not accurate in the monorepo style
"import/no-extraneous-dependencies": "off",
// Fontsource doesn't need to worry about heavyweight libraries
"no-restricted-syntax": "off",
},
};