Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .eslintrc

This file was deleted.

9 changes: 9 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import neostandard, { resolveIgnoresFromGitignore } from 'neostandard'

export default neostandard({
ts: true,
env: ['mocha'],
ignores: [
...resolveIgnoresFromGitignore(),
],
})
17 changes: 2 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"license": "MIT",
"engines": {
"node": ">=16.0.0"
"node": "18.20.7 || ^20.18.3 || >=22.14.0"
},
"files": [
"index.js",
Expand Down Expand Up @@ -47,32 +47,19 @@
"version:git": "git add CHANGELOG.md"
},
"devDependencies": {
"@socketsecurity/eslint-config": "^3.0.1",
"@tsconfig/node14": "^1.0.3",
"@types/chai": "^4.3.3",
"@types/chai-as-promised": "^7.1.5",
"@types/mocha": "^10.0.0",
"@types/node": "^14.18.36",
"@typescript-eslint/eslint-plugin": "^5.53.0",
"@typescript-eslint/parser": "^5.53.0",
"c8": "^7.13.0",
"chai": "^4.3.6",
"chai-as-promised": "^7.1.1",
"dependency-check": "^5.0.0-7",
"eslint": "^8.34.0",
"eslint-config-standard": "^17.0.0",
"eslint-config-standard-jsx": "^11.0.0",
"eslint-import-resolver-typescript": "^3.5.3",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jsdoc": "^40.0.0",
"eslint-plugin-n": "^15.6.1",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-unicorn": "^45.0.2",
"husky": "^8.0.3",
"installed-check": "^7.0.0",
"mocha": "^10.0.0",
"neostandard": "^0.12.0",
"npm-run-all2": "^6.0.2",
"type-coverage": "^2.24.1",
"typescript": "~5.1.3",
Expand Down
38 changes: 19 additions & 19 deletions test/parse.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,48 +17,48 @@ const should = chai.should()

/** @type {import('../index.js').SocketYml} */
const defaults = {
'version': 2,
'githubApp': {},
'issueRules': {},
'projectIgnorePaths': [],
version: 2,
githubApp: {},
issueRules: {},
projectIgnorePaths: [],
}

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

parseSocketConfig(fileContent).should.deep.equal({
'githubApp': {
'enabled': true,
'projectReportsEnabled': true,
'pullRequestAlertsEnabled': true,
githubApp: {
enabled: true,
projectReportsEnabled: true,
pullRequestAlertsEnabled: true,
},
'issueRules': {
'unresolvedRequire': false,
issueRules: {
unresolvedRequire: false,
},
'projectIgnorePaths': [
projectIgnorePaths: [
'workspaces/test*',
'!workspaces/test-framework',
],
'version': 2,
version: 2,
})
})

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

parseSocketConfig(fileContent).should.deep.equal({
'githubApp': {
'enabled': true,
'projectReportsEnabled': false,
'pullRequestAlertsEnabled': true,
githubApp: {
enabled: true,
projectReportsEnabled: false,
pullRequestAlertsEnabled: true,
},
'issueRules': {},
'projectIgnorePaths': [
issueRules: {},
projectIgnorePaths: [
'foo',
'bar',
],
'version': 2,
version: 2,
})
})

Expand Down
16 changes: 8 additions & 8 deletions test/read.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ chai.should()
describe('readSocketConfig()', () => {
it('should read and parse socket.yml', async () => {
await readSocketConfig(path.resolve(__dirname, 'sample.yml')).should.eventually.become({
'githubApp': {
'enabled': true,
'projectReportsEnabled': true,
'pullRequestAlertsEnabled': true,
githubApp: {
enabled: true,
projectReportsEnabled: true,
pullRequestAlertsEnabled: true,
},
'issueRules': {
'unresolvedRequire': false,
issueRules: {
unresolvedRequire: false,
},
'projectIgnorePaths': [
projectIgnorePaths: [
'workspaces/test*',
'!workspaces/test-framework',
],
'version': 2,
version: 2,
})
})

Expand Down