Skip to content

Commit e6b2ffa

Browse files
committed
Support gjs with linting, run prettier outside eslint
1 parent e424115 commit e6b2ffa

File tree

4 files changed

+178
-23
lines changed

4 files changed

+178
-23
lines changed

.eslintrc.js

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,12 @@ module.exports = {
1313
],
1414
},
1515
},
16-
plugins: ['ember'],
17-
extends: [
18-
'eslint:recommended',
19-
'plugin:ember/recommended',
20-
'plugin:prettier/recommended',
21-
],
16+
extends: ['eslint:recommended'],
2217
env: {
2318
browser: true,
2419
},
2520
rules: {
2621
'no-console': 'off',
27-
'ember/no-new-mixins': 'off',
28-
'ember/no-mixins': 'off',
29-
'ember/require-tagless-components': 'off',
30-
'ember/no-classic-classes': 'off',
31-
'ember/no-get': 'off',
32-
'ember/no-classic-components': 'off',
33-
'ember/no-private-routing-service': 'off',
3422
},
3523
overrides: [
3624
// node files
@@ -62,8 +50,35 @@ module.exports = {
6250
extends: ['plugin:n/recommended'],
6351
},
6452
{
65-
// test files
66-
files: ['tests/**/*-test.{js,ts}'],
53+
files: ['**/*.{js,ts}'],
54+
plugins: ['ember'],
55+
parser: '@typescript-eslint/parser',
56+
extends: [
57+
'eslint:recommended',
58+
'plugin:ember/recommended', // or other configuration
59+
],
60+
rules: {
61+
'ember/no-new-mixins': 'off',
62+
'ember/no-mixins': 'off',
63+
'ember/require-tagless-components': 'off',
64+
'ember/no-classic-classes': 'off',
65+
'ember/no-get': 'off',
66+
'ember/no-classic-components': 'off',
67+
'ember/no-private-routing-service': 'off',
68+
},
69+
},
70+
{
71+
files: ['**/*.gjs'],
72+
parser: 'ember-eslint-parser',
73+
plugins: ['ember'],
74+
extends: [
75+
'eslint:recommended',
76+
'plugin:ember/recommended',
77+
'plugin:ember/recommended-gjs',
78+
],
79+
},
80+
{
81+
files: ['tests/**/*.{js,ts,gjs,gts}'],
6782
extends: ['plugin:qunit/recommended'],
6883
},
6984
],

.prettierignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,15 @@
2323
/package.json.ember-try
2424
/package-lock.json.ember-try
2525
/yarn.lock.ember-try
26+
27+
# Misc files
28+
*.md
29+
pnpm-lock.yaml
30+
jsconfig.json
31+
32+
# api docs data
33+
/ember-api-docs-data/
34+
35+
36+
# hbs -- no point to prettier before moving to <template>
37+
*.hbs

package.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,17 @@
1515
"scripts": {
1616
"clone": "rm -rf ember-api-docs-data && git clone --depth=1 https://github.com/ember-learn/ember-api-docs-data.git",
1717
"build": "ember build --environment=production",
18-
"lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"",
18+
"format": "prettier . --cache --write",
19+
"lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\" --prefixColors auto",
1920
"lint:css": "stylelint \"**/*.css\"",
20-
"lint:css:fix": "concurrently \"npm:lint:css -- --fix\"",
21-
"lint:fix": "concurrently \"npm:lint:*:fix\" --names \"fix:\"",
21+
"lint:css:fix": "concurrently \"pnpm:lint:css -- --fix\"",
22+
"lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\" --prefixColors auto && pnpm run format",
23+
"lint:format": "prettier . --cache --check",
2224
"lint:hbs": "ember-template-lint .",
2325
"lint:hbs:fix": "ember-template-lint . --fix",
2426
"lint:js": "eslint . --cache",
25-
"start:local": "API_HOST=http://localhost:5050 ember serve",
2627
"lint:js:fix": "eslint . --fix",
28+
"start:local": "API_HOST=http://localhost:5050 ember serve",
2729
"start": "ember serve",
2830
"test:browserstack": "node run-tests.js",
2931
"test:ember": "ember test"
@@ -58,6 +60,7 @@
5860
"@types/ember__string": "^3.0.10",
5961
"@types/ember__test-helpers": "^2.8.2",
6062
"@types/ember__utils": "^4.0.2",
63+
"@typescript-eslint/parser": "^8.43.0",
6164
"algoliasearch": "^4.20.0",
6265
"broccoli-asset-rev": "^3.0.0",
6366
"broccoli-funnel": "^2.0.1",
@@ -87,6 +90,7 @@
8790
"ember-data": "~4.6.0",
8891
"ember-data-fastboot": "https://github.com/mainmatter/ember-data-fastboot#update-babel",
8992
"ember-decorators": "^6.1.1",
93+
"ember-eslint-parser": "^0.5.11",
9094
"ember-inflector": "^4.0.3",
9195
"ember-load-initializers": "^2.1.2",
9296
"ember-metrics": "^2.0.0",

pnpm-lock.yaml

Lines changed: 128 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)