Skip to content

Commit 8911380

Browse files
feat: Add ESLint configuration and tool definitions for linting TypeScript and JavaScript
1 parent f4fd690 commit 8911380

File tree

3 files changed

+186
-0
lines changed

3 files changed

+186
-0
lines changed

eslint.config.mjs

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
import emberPlugin from 'eslint-plugin-ember';
2+
import regexpPlugin from 'eslint-plugin-regexp';
3+
4+
export default [
5+
{
6+
plugins: {
7+
ember: emberPlugin,
8+
regexp: regexpPlugin
9+
},
10+
rules: {
11+
// Ember rules
12+
"ember/no-volatile-computed-properties": "error",
13+
"ember/no-assignment-of-untracked-properties-used-in-tracking-contexts": "error",
14+
"ember/no-restricted-resolver-tests": "error",
15+
"ember/no-component-lifecycle-hooks": "error",
16+
"ember/no-incorrect-calls-with-inline-anonymous-functions": "error",
17+
"ember/new-module-imports": "error",
18+
"ember/no-invalid-test-waiters": "error",
19+
"ember/routes-segments-snake-case": "error",
20+
"ember/no-settled-after-test-helper": "error",
21+
"ember/no-test-support-import": "error",
22+
"ember/closure-actions": "error",
23+
"ember/no-string-prototype-extensions": "error",
24+
"ember/no-deeply-nested-dependent-keys-with-each": "error",
25+
"ember/no-empty-glimmer-component-classes": "error",
26+
"ember/no-mixins": "error",
27+
"ember/no-try-invoke": "error",
28+
"ember/no-observers": "error",
29+
"ember/use-ember-data-rfc-395-imports": "error",
30+
"ember/no-on-calls-in-components": "error",
31+
"ember/no-new-mixins": "error",
32+
"ember/jquery-ember-run": "error",
33+
"ember/avoid-using-needs-in-controllers": "error",
34+
"ember/no-function-prototype-extensions": "error",
35+
"ember/no-attrs-in-components": "error",
36+
"ember/no-classic-classes": "error",
37+
"ember/classic-decorator-hooks": "error",
38+
"ember/require-valid-css-selector-in-test-helpers": "error",
39+
"ember/classic-decorator-no-classic-methods": "error",
40+
"ember/no-test-and-then": "error",
41+
"ember/no-actions-hash": "error",
42+
"ember/no-ember-super-in-es-classes": "error",
43+
"ember/no-duplicate-dependent-keys": "error",
44+
"ember/require-return-from-computed": "error",
45+
"ember/no-ember-testing-in-module-scope": "error",
46+
"ember/no-test-this-render": "error",
47+
"ember/avoid-leaking-state-in-ember-objects": "error",
48+
"ember/no-test-import-export": "error",
49+
50+
// Regexp rules
51+
"regexp/no-dupe-disjunctions": "error",
52+
"regexp/no-useless-assertions": "error",
53+
"regexp/no-useless-lazy": "error",
54+
"regexp/no-non-standard-flag": "error",
55+
"regexp/no-escape-backspace": "error",
56+
"regexp/strict": "error",
57+
"regexp/no-optional-assertion": "error",
58+
"regexp/prefer-star-quantifier": "error",
59+
"regexp/no-empty-alternative": "error",
60+
"regexp/confusing-quantifier": "error",
61+
"regexp/no-useless-two-nums-quantifier": "error",
62+
"regexp/no-useless-set-operand": "error",
63+
"regexp/no-super-linear-backtracking": "error",
64+
"regexp/no-useless-range": "error",
65+
"regexp/no-useless-flag": "error",
66+
"regexp/no-useless-dollar-replacements": "error",
67+
"regexp/no-useless-non-capturing-group": "error",
68+
"regexp/prefer-set-operation": "error",
69+
"regexp/no-dupe-characters-character-class": "error",
70+
"regexp/no-obscure-range": "error",
71+
"regexp/prefer-d": "error",
72+
"regexp/no-invisible-character": "error",
73+
"regexp/no-missing-g-flag": "error",
74+
"regexp/no-useless-escape": "error",
75+
"regexp/no-invalid-regexp": "error",
76+
"regexp/prefer-predefined-assertion": "error",
77+
"regexp/no-empty-string-literal": "error",
78+
"regexp/no-empty-character-class": "error",
79+
"regexp/no-empty-lookarounds-assertion": "error",
80+
"regexp/no-useless-backreference": "error",
81+
"regexp/no-empty-group": "error",
82+
"regexp/negation": "error",
83+
"regexp/optimal-lookaround-quantifier": "error",
84+
"regexp/prefer-plus-quantifier": "error",
85+
"regexp/prefer-question-quantifier": "error",
86+
"regexp/no-trivially-nested-quantifier": "error",
87+
"regexp/no-trivially-nested-assertion": "error",
88+
"regexp/no-useless-quantifier": "error",
89+
"regexp/prefer-range": "error",
90+
"regexp/no-zero-quantifier": "error",
91+
"regexp/prefer-character-class": "error",
92+
"regexp/no-legacy-features": "error",
93+
"regexp/sort-flags": "error",
94+
"regexp/control-character-escape": "error",
95+
"regexp/match-any": "error",
96+
"regexp/no-potentially-useless-backreference": "error",
97+
"regexp/no-useless-string-literal": "error",
98+
"regexp/no-useless-character-class": "error",
99+
"regexp/no-empty-capturing-group": "error",
100+
"regexp/optimal-quantifier-concatenation": "error",
101+
"regexp/no-misleading-unicode-character": "error",
102+
"regexp/no-contradiction-with-assertion": "error",
103+
"regexp/no-misleading-capturing-group": "error",
104+
"regexp/no-lazy-ends": "error",
105+
"regexp/simplify-set-operations": "error",
106+
"regexp/prefer-unicode-codepoint-escapes": "error",
107+
"regexp/use-ignore-case": "error"
108+
}
109+
}
110+
];

tools/definitions/eslint/tool.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
version: 0.1
2+
tools:
3+
definitions:
4+
- name: eslint
5+
runtime: node
6+
package: eslint
7+
shims: [eslint]
8+
known_good_version: 8.10.0
9+
lint:
10+
definitions:
11+
- name: eslint
12+
files: [typescript, javascript]
13+
tools: [eslint]
14+
description: Find and fix problems in your TS/JS code
15+
commands:
16+
- name: lint
17+
version: ">=9.0.0"
18+
direct_configs:
19+
- eslint.config.js
20+
- eslint.config.mjs
21+
- eslint.config.cjs
22+
output: eslint
23+
run: eslint --output-file ${tmpfile} --format json ${target}
24+
error_codes: [2]
25+
read_output_from: tmp_file
26+
batch: true
27+
- name: lint
28+
version: <=8.57.0
29+
direct_configs:
30+
- .eslintrc
31+
- .eslintrc.cjs
32+
- .eslintrc.js
33+
- .eslintrc.json
34+
- .eslintrc.mjs
35+
- .eslintrc.yaml
36+
- .eslintrc.yml
37+
output: eslint
38+
run: eslint --output-file ${tmpfile} --format json ${target}
39+
error_codes: [2]
40+
read_output_from: tmp_file
41+
batch: true
42+
suggest_if: config_present
43+
affects_cache:
44+
- .eslintignore
45+
- package.json
46+
- tsconfig.json
47+
issue_url_format: https://eslint.org/docs/rules/{}
48+
known_good_version: 8.10.0
49+
version_command:
50+
parse_regex: ${semver}
51+
run: eslint --version

tools/definitions/trivy/tool.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
version: 0.1
2+
downloads:
3+
- name: trivy
4+
downloads:
5+
- url: https://github.com/aquasecurity/trivy/releases/download/v${version}/trivy_${version}_Linux-${cpu}.tar.gz
6+
os: linux
7+
cpu:
8+
x86_64: 64bit
9+
arm_64: ARM64
10+
- url: https://github.com/aquasecurity/trivy/releases/download/v${version}/trivy_${version}_macOS-${cpu}.tar.gz
11+
os: macos
12+
cpu:
13+
x86_64: 64bit
14+
arm_64: ARM64
15+
- url: https://github.com/aquasecurity/trivy/releases/download/v${version}/trivy_${version}_windows-${cpu}.zip
16+
os: windows
17+
cpu:
18+
x86_64: 64bit
19+
arm_64: ARM64
20+
tools:
21+
definitions:
22+
- name: trivy
23+
download: trivy
24+
shims: [trivy]
25+
known_good_version: 0.44.1

0 commit comments

Comments
 (0)