@will-stone/eslint-config 0.7.0 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # @will-stone/eslint-config
2
2
 
3
+ My personal [ESLint](https://eslint.org/) config.
4
+
3
5
  ## Usage
4
6
 
5
7
  ### Install
@@ -55,8 +57,7 @@ the following to your `package.json`:
55
57
  "prepare": "husky install"
56
58
  },
57
59
  "lint-staged": {
58
- "*.{js,jsx,ts,tsx}": ["eslint --fix"],
59
- "*.{css,json,md}": ["prettier --write"]
60
+ "*.{js,jsx,ts,tsx}": ["eslint --fix"]
60
61
  }
61
62
  }
62
63
  ```
package/dist/index.cjs CHANGED
@@ -2011,22 +2011,23 @@ function unicorn() {
2011
2011
 
2012
2012
  // src/utils.ts
2013
2013
  var import_node_fs = require("fs");
2014
- var import_globby = require("globby");
2015
- var import_load_json_file = require("load-json-file");
2014
+ var import_glob = require("glob");
2015
+ function loadJsonFileSync(filePath) {
2016
+ const buffer = (0, import_node_fs.readFileSync)(filePath);
2017
+ const data = new TextDecoder().decode(buffer);
2018
+ return JSON.parse(data);
2019
+ }
2016
2020
  function checkEnvironment() {
2017
2021
  const isGitIgnore = (0, import_node_fs.existsSync)(".gitignore");
2018
2022
  let isNodeEngine = false;
2019
2023
  let isPrettier = false;
2020
2024
  let isTailwind = false;
2021
2025
  let testingFramework = null;
2022
- const allPackageJsonPaths = (0, import_globby.globbySync)([
2023
- "**/package.json",
2024
- // Could use the `gitIgnore` option but the negative pattern is about 8 times faster.
2025
- // https://github.com/sindresorhus/globby/issues/50
2026
- "!**/node_modules"
2027
- ]);
2026
+ const allPackageJsonPaths = (0, import_glob.globSync)("**/package.json", {
2027
+ ignore: "**/node_modules/**"
2028
+ });
2028
2029
  for (const packageJsonPath of allPackageJsonPaths) {
2029
- const packageJson = (0, import_load_json_file.loadJsonFileSync)(packageJsonPath);
2030
+ const packageJson = loadJsonFileSync(packageJsonPath);
2030
2031
  if (!testingFramework && Boolean(
2031
2032
  packageJson.dependencies?.jest || packageJson.devDependencies?.jest
2032
2033
  )) {
package/dist/index.d.cts CHANGED
@@ -5,4 +5,4 @@ import { Linter } from 'eslint';
5
5
  */
6
6
  declare function factory(): Linter.FlatConfig[];
7
7
 
8
- export { factory as default };
8
+ export = factory;
package/dist/index.js CHANGED
@@ -1974,21 +1974,22 @@ function unicorn() {
1974
1974
  }
1975
1975
 
1976
1976
  // src/utils.ts
1977
- import { existsSync } from "fs";
1978
- import { globbySync } from "globby";
1979
- import { loadJsonFileSync } from "load-json-file";
1977
+ import { existsSync, readFileSync } from "fs";
1978
+ import { globSync } from "glob";
1979
+ function loadJsonFileSync(filePath) {
1980
+ const buffer = readFileSync(filePath);
1981
+ const data = new TextDecoder().decode(buffer);
1982
+ return JSON.parse(data);
1983
+ }
1980
1984
  function checkEnvironment() {
1981
1985
  const isGitIgnore = existsSync(".gitignore");
1982
1986
  let isNodeEngine = false;
1983
1987
  let isPrettier = false;
1984
1988
  let isTailwind = false;
1985
1989
  let testingFramework = null;
1986
- const allPackageJsonPaths = globbySync([
1987
- "**/package.json",
1988
- // Could use the `gitIgnore` option but the negative pattern is about 8 times faster.
1989
- // https://github.com/sindresorhus/globby/issues/50
1990
- "!**/node_modules"
1991
- ]);
1990
+ const allPackageJsonPaths = globSync("**/package.json", {
1991
+ ignore: "**/node_modules/**"
1992
+ });
1992
1993
  for (const packageJsonPath of allPackageJsonPaths) {
1993
1994
  const packageJson = loadJsonFileSync(packageJsonPath);
1994
1995
  if (!testingFramework && Boolean(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@will-stone/eslint-config",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "description": "Will Stone's ESLint config",
5
5
  "keywords": [
6
6
  "eslint-config"
@@ -25,7 +25,7 @@
25
25
  "dist"
26
26
  ],
27
27
  "scripts": {
28
- "build": "tsup src/index.ts --format esm,cjs --clean --dts",
28
+ "build": "tsup src/index.ts --format esm,cjs --clean --dts --cjsInterop",
29
29
  "dev": "tsup src/index.ts --format esm,cjs --watch & eslint-flat-config-viewer",
30
30
  "lint": "npm run stub && eslint .",
31
31
  "prepare": "husky install",
@@ -61,6 +61,7 @@
61
61
  "eslint-plugin-switch-case": "^1.1.2",
62
62
  "eslint-plugin-tailwindcss": "^3.13.0",
63
63
  "eslint-plugin-unicorn": "^48.0.1",
64
+ "glob": "^10.3.10",
64
65
  "globals": "^13.22.0",
65
66
  "globby": "^13.2.2",
66
67
  "load-json-file": "^7.0.1"