@bonniernews/eslint-config 2.0.3 → 2.0.5

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
@@ -214,12 +214,7 @@ Can be found [here](CHANGELOG.md).
214
214
 
215
215
  ## Publishing a new version
216
216
 
217
- 1. Prepare the new version
218
- 2. Fill out the [CHANGELOG](CHANGELOG.md)
219
- 3. Ensure that package-lock, et al are up-to-date
220
- 4. Commit
221
- 5. Tag
222
- 6. Publish, when publishing ensure that you have a token in ~/.npmrc with auth for npm.pkg.github.com as we publish both to our own registry and to the npm registry
217
+ We automatically publish to both NPM and GitHub when you bump the version in package.json
223
218
 
224
219
  ## License
225
220
 
package/base-config.js CHANGED
@@ -9,22 +9,28 @@ const eslintPluginN = require("eslint-plugin-n");
9
9
  const eslintPluginImport = require("eslint-plugin-import");
10
10
  const eslintPluginTypescriptRules = require("@bonniernews/eslint-plugin-typescript-rules");
11
11
 
12
- function findPackageJson(startDir) {
13
- let dir = path.resolve(startDir || process.cwd());
12
+ function findPackageJson() {
13
+ let dir = process.cwd();
14
+ const root = path.parse(dir).root;
14
15
 
15
- do {
16
+ while (dir !== root) {
16
17
  const pkgfile = path.join(dir, "package.json");
17
18
 
18
- if (!fs.existsSync(pkgfile)) {
19
- dir = path.join(dir, "..");
20
- continue;
19
+ if (fs.existsSync(pkgfile)) {
20
+ return pkgfile;
21
21
  }
22
- return pkgfile;
23
- } while (dir !== path.resolve(dir, "..") && !fs.existsSync(path.resolve(dir, ".git")));
22
+
23
+ if (fs.existsSync(path.join(dir, ".git"))) {
24
+ break;
25
+ }
26
+
27
+ dir = path.join(dir, "..");
28
+ }
29
+
24
30
  return null;
25
31
  }
26
32
 
27
- const isModuleProject = require(findPackageJson(fs.realpathSync(process.cwd()))).type === "module";
33
+ const isModuleProject = require(findPackageJson()).type === "module";
28
34
  const hasES2022Support = parseInt(process.versions.node.split(".").shift(), 10) >= 16;
29
35
 
30
36
  const moduleConfig = {
package/package.json CHANGED
@@ -1,12 +1,10 @@
1
1
  {
2
2
  "name": "@bonniernews/eslint-config",
3
- "version": "2.0.3",
3
+ "version": "2.0.5",
4
4
  "description": "ESLint config",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
- "test": "mocha && eslint .",
8
- "postpublish": "npm run publish-npm",
9
- "publish-npm": "npm publish --access public --ignore-scripts --@bonniernews:registry='https://npm.pkg.github.com'"
7
+ "test": "mocha && eslint ."
10
8
  },
11
9
  "repository": {
12
10
  "type": "git",
@@ -24,7 +22,7 @@
24
22
  "devDependencies": {
25
23
  "chai": "^4.3.10",
26
24
  "eslint": "^9.19.0",
27
- "mocha": "^11.1.0",
25
+ "mocha": "^11.3.0",
28
26
  "mocha-cakes-2": "^3.3.0",
29
27
  "typescript": "^5.7.3"
30
28
  },