-
Notifications
You must be signed in to change notification settings - Fork 93
Expand file tree
/
Copy path.eslintrc.js
More file actions
124 lines (121 loc) · 3.16 KB
/
Copy path.eslintrc.js
File metadata and controls
124 lines (121 loc) · 3.16 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
const path = require('path');
const VALID_CATEGORIES = [
'Base Classes',
'Hooks',
'Interfaces',
'Models - Classification',
'Models - Image Embeddings',
'Models - Image Generation',
'Models - LLM',
'Models - LLM Multimodal',
'Models - Object Detection',
'Models - Instance Segmentation',
'Models - Pose Estimation',
'Models - Semantic Segmentation',
'Models - Speech To Text',
'Models - Style Transfer',
'Models - Privacy Filter',
'Models - Text Embeddings',
'Models - Text to Speech',
'Models - VLM',
'Models - Voice Activity Detection',
'OCR Supported Alphabets',
'TTS Supported Voices',
'Types',
'Typescript API',
'Utils',
'Utilities - General',
'Utilities - LLM',
];
const CATEGORY_TAG_MATCH = `^(${VALID_CATEGORIES.join('|')})$`;
module.exports = {
parserOptions: {
requireConfigFile: false,
babelOptions: {
presets: ['@babel/preset-react'],
},
},
root: true,
extends: [
'@react-native',
'plugin:@cspell/recommended',
'plugin:prettier/recommended',
'plugin:markdown/recommended-legacy',
'plugin:jsdoc/recommended-typescript',
],
rules: {
'react/react-in-jsx-scope': 'off',
'prettier/prettier': [
'error',
{
quoteProps: 'consistent',
singleQuote: true,
tabWidth: 2,
trailingComma: 'es5',
useTabs: false,
},
],
'@cspell/spellchecker': [
'warn',
{
customWordListFile: path.resolve(__dirname, '.cspell-wordlist.txt'),
},
],
// `properties: 'never'` lets the lowercase snake_case keys in `models`
// (e.g. `models.text_to_speech.kokoro_small`, mirroring the underlying
// `.pte` filenames) pass while still requiring camelCase for variable
// and function declarations.
'camelcase': ['error', { properties: 'never' }],
'jsdoc/require-jsdoc': 'off',
'jsdoc/require-param': ['error', { checkDestructured: false }],
'jsdoc/check-param-names': ['error', { checkDestructured: false }],
'jsdoc/require-yields-type': 'off',
'jsdoc/require-yields-description': 'warn',
'jsdoc/check-tag-names': ['error', { definedTags: ['property'] }],
'jsdoc/match-description': [
'error',
{
contexts: ['any'],
mainDescription: false,
tags: {
category: {
message:
'@category must be one of categories defined in .eslintrc.js',
match: CATEGORY_TAG_MATCH,
},
},
},
],
},
plugins: ['prettier', 'markdown', 'jsdoc'],
overrides: [
{
files: ['packages/react-native-executorch/src/**/*.{js,jsx,ts,tsx}'],
rules: {
'no-console': 'warn',
},
},
{
files: ['**/*.md'],
processor: 'markdown/markdown',
},
{
files: ['**/*.md/*.{ts,tsx}'],
rules: {
'no-console': 'off',
'react-hooks/rules-of-hooks': 'off',
'react/jsx-no-undef': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
'camelcase': 'warn',
},
},
],
ignorePatterns: ['node_modules/', 'lib/', '**/build/'],
settings: {
jsdoc: {
tagNamePreference: {
typeParam: 'typeParam',
},
},
},
};