-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
74 lines (67 loc) · 1.81 KB
/
eslint.config.js
File metadata and controls
74 lines (67 loc) · 1.81 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
import neostandard, { resolveIgnoresFromGitignore } from 'neostandard'
import { jsdoc } from 'eslint-plugin-jsdoc'
/**
* ESLint Configuration
*
* This configuration uses neostandard (modern StandardJS) with JSDoc validation.
*
* Key features:
* - StandardJS code style rules
* - JSDoc comment validation
* - Browser environment globals
* - Test-specific rules for Chai assertions
*
* Commands:
* npm run eslint - Run linter
* npm run eslint-fix - Auto-fix issues
*/
const config = [
// Base neostandard configuration for browser environment
...neostandard({
env: ['browser'],
ts: false,
ignores: resolveIgnoresFromGitignore(),
files: ['*.js']
}),
// JSDoc validation plugin
jsdoc({
config: 'flat/recommended',
rules: {
// Allow "any" type in JSDoc (sometimes necessary)
'jsdoc/reject-any-type': ['off'],
// Define browser and Web Platform types that JSDoc doesn't know about
'jsdoc/no-undefined-types': [1, {
definedTypes: [
'NodeListOf',
'FileSystemFileHandle',
'FocusOptions'
]
}],
// Allow custom JSDoc tags used for web components
'jsdoc/check-tag-names': [1, {
definedTags: ['attr', 'cssprop', 'tagname']
}]
}
}),
// Special configuration for test files
{
files: ['test/**/*.test.js'],
languageOptions: {
globals: {
// Mocha/BDD test globals
describe: 'readonly',
it: 'readonly',
before: 'readonly',
after: 'readonly',
beforeEach: 'readonly',
afterEach: 'readonly'
}
},
rules: {
// Chai assertions like `expect(foo).to.be.true` look like unused expressions
'no-unused-expressions': 'off',
'@stylistic/no-unused-expressions': 'off'
}
}
]
export default config