-
Notifications
You must be signed in to change notification settings - Fork 156
Expand file tree
/
Copy patheslint.config.js
More file actions
67 lines (62 loc) · 1.95 KB
/
eslint.config.js
File metadata and controls
67 lines (62 loc) · 1.95 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
import path from 'node:path';
import { includeIgnoreFile } from '@eslint/compat';
import { globalIgnores } from 'eslint/config';
import js from '@eslint/js';
import { configs } from 'eslint-config-airbnb-extended/legacy';
const gitignorePath = path.resolve('.', '.gitignore');
const jsConfig = [
{
name: 'js/config',
...js.configs.recommended,
},
...configs.base.recommended,
];
const typescriptConfig = [
...configs.base.typescript,
];
// eslint-disable-next-line import/no-default-export
export default [
includeIgnoreFile(gitignorePath),
...jsConfig,
...typescriptConfig,
{
rules: {
'linebreak-style': 'off',
// sgp4 and sgp4init extensively use parameter reassignment
'no-param-reassign': ['error', { props: true, ignorePropertyModificationsFor: ['satrec'] }],
// Emscripten compiles C++ functions to JS with underscores
'no-underscore-dangle': ['off'],
// almost identical to default, but allows for...of loops, which are used for performance
'no-restricted-syntax': [
'error',
'LabeledStatement',
'WithStatement',
],
// allow ++ in for loops
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
// the first is disabled, and the second covers this
'default-case': 'off',
// prefer named exports since they autocomplete and refactor easily
'import/prefer-default-export': 'off',
'import/no-default-export': 'error',
// needed to implement Calculator interface
'class-methods-use-this': ['error', { ignoreClassesWithImplements: 'public-fields' }],
},
settings: {
'import/resolver': {
typescript: {
// we have separate tsconfigs for source, tests, and docs
noWarnOnMultipleProjects: true,
project: '*/tsconfig.json',
},
},
},
},
globalIgnores([
'sgp4_verification/*',
'wasm-build/*',
'docs/*',
'*.config.{mjs,ts}',
'rollup.*',
])
];