Skip to content

Commit 3df2843

Browse files
committed
Update lint setup
1 parent 19831ac commit 3df2843

5 files changed

Lines changed: 137 additions & 123 deletions

File tree

.eslintrc.js

Lines changed: 14 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,23 @@
11
module.exports = {
2-
root: true,
3-
parser: '@babel/eslint-parser',
4-
parserOptions: {
5-
ecmaVersion: 'latest',
6-
requireConfigFile: false,
7-
sourceType: 'module'
8-
},
92
extends: [
103
'eslint:recommended',
11-
'plugin:prettier/recommended',
4+
'plugin:n/recommended',
5+
'prettier',
126
],
13-
rules: {},
147
overrides: [
15-
// node files
16-
{
17-
files: [
18-
'.template-lintrc.js',
19-
'ember-cli-build.js',
20-
'index.js',
21-
'testem.js',
22-
'blueprints/*/index.js',
23-
'config/**/*.js',
24-
'tests/dummy/config/**/*.js',
25-
'test/**/*.js',
26-
'lib/**/*.js'
27-
],
28-
excludedFiles: [
29-
'addon/**',
30-
'addon-test-support/**',
31-
'app/**',
32-
'tests/dummy/app/**'
33-
],
34-
parserOptions: {
35-
sourceType: 'script',
36-
ecmaVersion: 2018
37-
},
38-
env: {
39-
browser: false,
40-
node: true
41-
},
42-
extends: ['plugin:node/recommended'],
43-
rules: {
44-
// add your custom rules and overrides for node files here
45-
'no-process-exit': 'off'
46-
}
47-
},
48-
// test files
498
{
509
env: { mocha: true },
5110
files: ['test/**/*.js'],
52-
}
53-
]
11+
},
12+
],
13+
parser: '@babel/eslint-parser',
14+
parserOptions: {
15+
ecmaVersion: 'latest',
16+
requireConfigFile: false,
17+
sourceType: 'script',
18+
},
19+
root: true,
20+
rules: {
21+
'n/no-process-exit': 'off',
22+
},
5423
};

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
/testem.log
1717
/yarn-error.log
1818

19+
/.eslintcache
1920
/.nyc_output
2021
*.tgz
2122
.scratch

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/CHANGELOG.md

package.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@
2222
"test": "tests"
2323
},
2424
"scripts": {
25-
"lint": "eslint .",
25+
"format": "prettier . --cache --write",
26+
"lint": "concurrently --group --prefix-colors auto --timings \"yarn:lint:*(!fix)\"",
27+
"lint:fix": "concurrently --group --prefix-colors auto --timings \"yarn:lint:*:fix\" && yarn format",
28+
"lint:format": "prettier . --cache --check",
29+
"lint:js": "eslint . --cache",
30+
"lint:js:fix": "eslint . --fix",
2631
"node-test": "mocha test/**/*.js",
2732
"node-test-with-coverage": "nyc --reporter lcov npm run-script node-test",
2833
"start": "ember serve",
@@ -42,16 +47,17 @@
4247
"walk-sync": "^2.2.0"
4348
},
4449
"devDependencies": {
50+
"@babel/core": "^7.26.0",
4551
"@babel/eslint-parser": "^7.25.9",
4652
"@release-it-plugins/lerna-changelog": "^7.0.0",
4753
"chai": "^4.4.1",
4854
"chai-as-promised": "^7.1.1",
4955
"codecov": "^3.8.3",
56+
"concurrently": "^9.1.0",
5057
"ember-cli": "~5.12.0",
5158
"eslint": "^8.57.0",
5259
"eslint-config-prettier": "^9.1.0",
53-
"eslint-plugin-node": "^11.1.0",
54-
"eslint-plugin-prettier": "^5.2.1",
60+
"eslint-plugin-n": "^17.15.0",
5561
"mocha": "^10.8.2",
5662
"mockery": "^2.1.0",
5763
"nyc": "^17.1.0",

0 commit comments

Comments
 (0)