Skip to content

Commit 42388f4

Browse files
authored
Merge pull request #39 from SocketDev/simplify-eslint
2 parents a7c3473 + 3c0ab19 commit 42388f4

File tree

5 files changed

+38
-55
lines changed

5 files changed

+38
-55
lines changed

.eslintrc

Lines changed: 0 additions & 13 deletions
This file was deleted.

eslint.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import neostandard, { resolveIgnoresFromGitignore } from 'neostandard'
2+
3+
export default neostandard({
4+
ts: true,
5+
env: ['mocha'],
6+
ignores: [
7+
...resolveIgnoresFromGitignore(),
8+
],
9+
})

package.json

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"license": "MIT",
1717
"engines": {
18-
"node": ">=16.0.0"
18+
"node": "18.20.7 || ^20.18.3 || >=22.14.0"
1919
},
2020
"files": [
2121
"index.js",
@@ -47,32 +47,19 @@
4747
"version:git": "git add CHANGELOG.md"
4848
},
4949
"devDependencies": {
50-
"@socketsecurity/eslint-config": "^3.0.1",
5150
"@tsconfig/node14": "^1.0.3",
5251
"@types/chai": "^4.3.3",
5352
"@types/chai-as-promised": "^7.1.5",
5453
"@types/mocha": "^10.0.0",
5554
"@types/node": "^14.18.36",
56-
"@typescript-eslint/eslint-plugin": "^5.53.0",
57-
"@typescript-eslint/parser": "^5.53.0",
5855
"c8": "^7.13.0",
5956
"chai": "^4.3.6",
6057
"chai-as-promised": "^7.1.1",
6158
"dependency-check": "^5.0.0-7",
62-
"eslint": "^8.34.0",
63-
"eslint-config-standard": "^17.0.0",
64-
"eslint-config-standard-jsx": "^11.0.0",
65-
"eslint-import-resolver-typescript": "^3.5.3",
66-
"eslint-plugin-import": "^2.27.5",
67-
"eslint-plugin-jsdoc": "^40.0.0",
68-
"eslint-plugin-n": "^15.6.1",
69-
"eslint-plugin-promise": "^6.1.1",
70-
"eslint-plugin-react": "^7.32.2",
71-
"eslint-plugin-react-hooks": "^4.6.0",
72-
"eslint-plugin-unicorn": "^45.0.2",
7359
"husky": "^8.0.3",
7460
"installed-check": "^7.0.0",
7561
"mocha": "^10.0.0",
62+
"neostandard": "^0.12.0",
7663
"npm-run-all2": "^6.0.2",
7764
"type-coverage": "^2.24.1",
7865
"typescript": "~5.1.3",

test/parse.spec.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,48 +17,48 @@ const should = chai.should()
1717

1818
/** @type {import('../index.js').SocketYml} */
1919
const defaults = {
20-
'version': 2,
21-
'githubApp': {},
22-
'issueRules': {},
23-
'projectIgnorePaths': [],
20+
version: 2,
21+
githubApp: {},
22+
issueRules: {},
23+
projectIgnorePaths: [],
2424
}
2525

2626
describe('parseSocketConfig()', () => {
2727
it('should read and parse socket.yml', async () => {
2828
const fileContent = await readFile(path.resolve(__dirname, 'sample.yml'), 'utf8')
2929

3030
parseSocketConfig(fileContent).should.deep.equal({
31-
'githubApp': {
32-
'enabled': true,
33-
'projectReportsEnabled': true,
34-
'pullRequestAlertsEnabled': true,
31+
githubApp: {
32+
enabled: true,
33+
projectReportsEnabled: true,
34+
pullRequestAlertsEnabled: true,
3535
},
36-
'issueRules': {
37-
'unresolvedRequire': false,
36+
issueRules: {
37+
unresolvedRequire: false,
3838
},
39-
'projectIgnorePaths': [
39+
projectIgnorePaths: [
4040
'workspaces/test*',
4141
'!workspaces/test-framework',
4242
],
43-
'version': 2,
43+
version: 2,
4444
})
4545
})
4646

4747
it('should read and parse socket.yml v1', async () => {
4848
const fileContent = await readFile(path.resolve(__dirname, 'sample-v1.yml'), 'utf8')
4949

5050
parseSocketConfig(fileContent).should.deep.equal({
51-
'githubApp': {
52-
'enabled': true,
53-
'projectReportsEnabled': false,
54-
'pullRequestAlertsEnabled': true,
51+
githubApp: {
52+
enabled: true,
53+
projectReportsEnabled: false,
54+
pullRequestAlertsEnabled: true,
5555
},
56-
'issueRules': {},
57-
'projectIgnorePaths': [
56+
issueRules: {},
57+
projectIgnorePaths: [
5858
'foo',
5959
'bar',
6060
],
61-
'version': 2,
61+
version: 2,
6262
})
6363
})
6464

test/read.spec.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ chai.should()
1515
describe('readSocketConfig()', () => {
1616
it('should read and parse socket.yml', async () => {
1717
await readSocketConfig(path.resolve(__dirname, 'sample.yml')).should.eventually.become({
18-
'githubApp': {
19-
'enabled': true,
20-
'projectReportsEnabled': true,
21-
'pullRequestAlertsEnabled': true,
18+
githubApp: {
19+
enabled: true,
20+
projectReportsEnabled: true,
21+
pullRequestAlertsEnabled: true,
2222
},
23-
'issueRules': {
24-
'unresolvedRequire': false,
23+
issueRules: {
24+
unresolvedRequire: false,
2525
},
26-
'projectIgnorePaths': [
26+
projectIgnorePaths: [
2727
'workspaces/test*',
2828
'!workspaces/test-framework',
2929
],
30-
'version': 2,
30+
version: 2,
3131
})
3232
})
3333

0 commit comments

Comments
 (0)