@amedia/kragl-utils
Advanced tools
Comparing version 0.0.0-20240206173406 to 0.0.0-esm-rc-20241115102141
# @amedia/kragl-utils | ||
## 0.0.0-20240206173406 | ||
## 0.0.0-esm-rc-20241115102141 | ||
### Major Changes | ||
- a4e7dd9: break out eslint-config-prettier to its own package | ||
- 5db918d: Kragl 4.x | ||
### Patch Changes | ||
_Get ready: This release breaks the world._ | ||
- 73ba203: add recommended eslint config for eslintrc | ||
ESLint 9 introduces a new configuration format (flat config files)[^1] | ||
so as we move to ESLint 9 we need to re-do all the ESLint configuration | ||
both in this package, and in downstream repos. | ||
See the configuration docs for how to setup kragl for your project. | ||
[^1]: https://eslint.org/docs/latest/use/configure/configuration-files | ||
We are all-in on ECMAScript Modules at Amedia, but have been held back | ||
in this repo due to the tools we depend on have lagged behind. Now the | ||
world is ready, and we are making the move. | ||
Changes that hit the consumer are things like `.prettierrc.cjs` will not | ||
work with the `@amedia/prettier-config` package and the consumer needs | ||
to move to `prettier.config.js` with ESM syntax. | ||
`@amedia/eslint-config` exports an helper function that generates an | ||
ESLint configuration that complies with our standards, it supports both | ||
toggling options and full-on custom configuration. | ||
For example, a TypeScript + Svelte project: | ||
``` | ||
import eslintConfig from '@amedia/eslint-config'; | ||
export default eslintConfig({ | ||
typescript: true, | ||
svelte: true, | ||
}); | ||
``` | ||
We have had a long-standing issue of the LSP hanging when interacting | ||
with our Prettier configuration. This was likely due to our Prettier | ||
configuration dynamically loading the Svelte plugin if it was necessary. | ||
Some versions of Prettier struggle with that, so for kragl 4.x the | ||
consumer manually decides if the standard or svelte prettier | ||
configuration should be used. | ||
Standard: | ||
``` | ||
// prettier.config.js | ||
export { default } from '@amedia/prettier-config'; | ||
``` | ||
Svelte: | ||
``` | ||
// prettier.config.js | ||
export { svelte as default } from '@amedia/prettier-config'; | ||
``` | ||
## 1.2.1 | ||
@@ -14,0 +64,0 @@ |
@@ -5,4 +5,4 @@ import { dirname, join } from 'node:path'; | ||
import { readPackageUp, getConsumingRoot } from './pkg-up.js'; | ||
import { objHasKey } from './obj-has-key.js'; | ||
import { getConsumingRoot, readPackageUp } from './pkg-up.js'; | ||
@@ -9,0 +9,0 @@ export function hasConfig(sources) { |
@@ -0,4 +1,4 @@ | ||
import { readdirSync, readFileSync } from 'node:fs'; | ||
import { dirname, join, resolve } from 'node:path'; | ||
import { fileURLToPath } from 'node:url'; | ||
import { readdirSync, readFileSync } from 'node:fs'; | ||
import { dirname, resolve, join } from 'node:path'; | ||
@@ -5,0 +5,0 @@ import fg from 'fast-glob'; |
@@ -5,4 +5,4 @@ import { dirname, join } from 'node:path'; | ||
import { localBin } from './bin.js'; | ||
import { getConsumingRoot, readPackageUp } from './pkg-up.js'; | ||
import { localBin } from './bin.js'; | ||
@@ -9,0 +9,0 @@ export function findPlugins() { |
{ | ||
"name": "@amedia/kragl-utils", | ||
"version": "0.0.0-20240206173406", | ||
"version": "0.0.0-esm-rc-20241115102141", | ||
"description": "Utility functions for Kragl", | ||
@@ -5,0 +5,0 @@ "type": "module", |
15270