-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
eslint.config.js
49 lines (43 loc) · 1.51 KB
/
eslint.config.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
import pluginJs from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
import eslintPluginPrettier from 'eslint-plugin-prettier';
export default [
// Google configuration
pluginJs.configs.recommended,
// Prettier configuration
eslintConfigPrettier,
{
// Specify language options including parser options
languageOptions: {
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
globals: {
es6: true,
node: true,
browser: true, // Define browser globals
},
},
// Include plugins
plugins: {
prettier: eslintPluginPrettier,
},
// Define rules
rules: {
'prettier/prettier': 'error', // Show Prettier errors as ESLint errors
camelcase: ['warn', { properties: 'always' }], // Warn on camel case violations
'max-len': ['warn', { code: 80, ignoreTemplateLiterals: true }], // Warn if lines exceed 80 characters
'no-undef': 'off', // Disable no-undef rule since Google Apps Script has global variables
'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }], // Warn on unused variables but ignore those starting with _
},
// Ignore specific files or directories
ignores: [
'**/*.config.js', // Ignore all config files
'**/node_modules/**', // Ignore node_modules directory
'**/*.test.js', // Ignore test files if applicable
'**/dist/**', // Ignore distribution files if applicable
'**/docs/**', // Ignore docs directory
],
},
];