Skip to content

Commit

Permalink
Add changesets
Browse files Browse the repository at this point in the history
  • Loading branch information
stormwarning committed Nov 15, 2023
1 parent 43793bc commit 35b4260
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 58 deletions.
8 changes: 8 additions & 0 deletions .changeset/blue-doors-impress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@zazen/cli': minor
---

Upgrade dependencies

- Upgrade `eslint` to 8.53.0
- Upgrade `prettier` to 3.1.0
14 changes: 14 additions & 0 deletions .changeset/five-balloons-applaud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
'@zazen/eslint-config': minor
---

Upgrade dependencies

- Upgrade @rushstack/eslint-patch to 1.5.1
- Upgrade @typescript-eslint/eslint-plugin to 6.11.0
- Upgrade @typescript-eslint/parser to 6.11.0
- Upgrade eslint-config-prettier to 9.0.0
- Upgrade eslint-config-xo-typescript to 1.0.1
- Upgrade eslint-plugin-etc to 2.0.3
- Upgrade eslint-plugin-n to 16.3.1
- Upgrade eslint-plugin-unicorn to 49.0.0
12 changes: 0 additions & 12 deletions packages/eslint-config/__tests__/package.json

This file was deleted.

97 changes: 51 additions & 46 deletions packages/eslint-config/__tests__/test.mjs
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
// Import { createRequire } from 'node:module'
import { createRequire } from 'node:module'

import test from 'ava'
// Import { ESLint } from 'eslint'
// import isPlainObj from 'is-plain-obj'
import { ESLint } from 'eslint'
import isPlainObj from 'is-plain-obj'

// const require = createRequire(import.meta.url)
// const hasRule = (errors, ruleId) =>
// errors.some((error) => error.ruleId === ruleId)
const require = createRequire(import.meta.url)
const hasRule = (errors, ruleId) =>
errors.some((error) => error.ruleId === ruleId)

// async function runEslint(string, config) {
// let eslint = new ESLint({
// useEslintrc: false,
// overrideConfig: config,
// })
async function runEslint(string, config) {
let eslint = new ESLint({
useEslintrc: false,
overrideConfig: {
...config,
rules: {
'unicorn/expiring-todo-comments': 'off',
},
},
})

// let [firstResult] = await eslint.lintText(string)
let [firstResult] = await eslint.lintText(string)

// return firstResult.messages
// }
return firstResult.messages
}

test('no op', async (t) => {
/**
Expand All @@ -27,35 +32,35 @@ test('no op', async (t) => {
t.true(true)
})

// Test('main', async (t) => {
// let config = require('../index.js')

// t.true(isPlainObj(config))
// t.true(isPlainObj(config.rules))

// let errors = await runEslint(
// "'use strict';\nfunction q() { const foo = 'FOO' }\n",
// config,
// )
// t.true(hasRule(errors, 'prefer-let/prefer-let'), JSON.stringify(errors))
// })

// test('node', async (t) => {
// let config = require('../node.js')

// t.true(isPlainObj(config))
// t.true(isPlainObj(config.rules))

// let errors = await runEslint(
// "import path from 'path'\nimport foo from './utils/foo'\n",
// {
// parserOptions: { sourceType: 'module', ecmaVersion: 2020 },
// ...config,
// },
// )
// /** @todo Figure out why this rule isn't being caught in tests. */
// t.false(
// hasRule(errors, 'n/file-extension-in-import'),
// JSON.stringify(errors),
// )
// })
test.skip('main', async (t) => {
let config = require('../index.js')

t.true(isPlainObj(config))
t.true(isPlainObj(config.rules))

let errors = await runEslint(
"'use strict';\nfunction q() { const foo = 'FOO' }\n",
config,
)
t.true(hasRule(errors, 'prefer-let/prefer-let'), JSON.stringify(errors))
})

test.skip('node', async (t) => {
let config = require('../node.js')

t.true(isPlainObj(config))
t.true(isPlainObj(config.rules))

let errors = await runEslint(
"import path from 'path'\nimport foo from './utils/foo'\n",
{
parserOptions: { sourceType: 'module', ecmaVersion: 2020 },
...config,
},
)
/** @todo Figure out why this rule isn't being caught in tests. */
t.false(
hasRule(errors, 'n/file-extension-in-import'),
JSON.stringify(errors),
)
})

0 comments on commit 35b4260

Please sign in to comment.