@changke/staticnext-build 0.9.0 → 0.9.1

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/CHANGELOG.md CHANGED
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## 0.9.1
8
+ 2024-09-13
9
+ ### Added
10
+ - Use `@stylistic/eslint-plugin` for stylistic linting
11
+
7
12
  ## 0.9.0
8
13
  2024-09-10
9
14
  ### Changed
package/eslint.config.mjs CHANGED
@@ -1,8 +1,14 @@
1
1
  import globals from 'globals';
2
2
  import js from '@eslint/js';
3
+ import stylistic from '@stylistic/eslint-plugin';
3
4
 
4
5
  export default [
5
6
  js.configs.recommended,
7
+ stylistic.configs.customize({
8
+ blockSpacing: false,
9
+ braceStyle: '1tbs',
10
+ semi: true
11
+ }),
6
12
  {
7
13
  files: ['**/*.mjs'],
8
14
  languageOptions: {
@@ -12,9 +18,13 @@ export default [
12
18
  }
13
19
  },
14
20
  rules: {
15
- 'quotes': ['warn', 'single'],
16
- 'semi': ['error', 'always'],
17
- 'comma-dangle': ['error', 'never']
21
+ '@stylistic/arrow-parens': ['error', 'as-needed', {requireForBlockBody: false}],
22
+ '@stylistic/comma-dangle': ['error', 'never'],
23
+ '@stylistic/object-curly-spacing': ['error', 'never'],
24
+ '@stylistic/quotes': ['warn', 'single'],
25
+ '@stylistic/quote-props': 0,
26
+ '@stylistic/semi': ['error', 'always'],
27
+ '@stylistic/space-before-function-paren': ['error', {anonymous: 'ignore', asyncArrow: 'always', named: 'never'}]
18
28
  }
19
29
  }
20
30
  ];
@@ -6,7 +6,7 @@ import {deleteAsync} from 'del';
6
6
  * @param {(string|string[])} targetPath
7
7
  * @returns {Promise<string[]>}
8
8
  */
9
- const clean = (targetPath) => {
9
+ const clean = targetPath => {
10
10
  console.log('=> clean');
11
11
  return deleteAsync(targetPath);
12
12
  };
@@ -6,7 +6,7 @@ import cpy from 'cpy';
6
6
  * @param {STPair[]} sourceTargetPairs
7
7
  * @return {Promise<Awaited<unknown>[]>}
8
8
  */
9
- const copy = (sourceTargetPairs) => {
9
+ const copy = sourceTargetPairs => {
10
10
  console.log('=> copy');
11
11
  return Promise.all(sourceTargetPairs.map(pair => cpy(pair.sources, pair.target, pair.opts)));
12
12
  };
@@ -55,7 +55,7 @@ const markdown = (mdSourcePathRoot, njkPaths, njkGlobals, mdTargetPath) => {
55
55
  for (const [k, v] of Object.entries(njkGlobals)) {
56
56
  njkEnv.addGlobal(k, v);
57
57
  }
58
- return Promise.all(docs.map(async (doc) => {
58
+ return Promise.all(docs.map(async doc => {
59
59
  const mdContent = await readFile(doc, {encoding: 'utf8'});
60
60
  const html = marked.parse(mdContent);
61
61
  const pageTitle = getPageTitle(mdContent);
@@ -22,7 +22,7 @@ const prototype = (prototypeSourcePathRoot, njkPaths, njkGlobals, prototypeTarge
22
22
  for (const [k, v] of Object.entries(njkGlobals)) {
23
23
  njkEnv.addGlobal(k, v);
24
24
  }
25
- return Promise.all(pages.map(async (page) => {
25
+ return Promise.all(pages.map(async page => {
26
26
  const pageContent = await readFile(page, {encoding: 'utf8'});
27
27
  const res = njkEnv.renderString(pageContent);
28
28
  const targetFile = getTargetPathString(
@@ -1,5 +1,5 @@
1
1
  const setEnvDev = () => {
2
- return new Promise((resolve) => {
2
+ return new Promise(resolve => {
3
3
  process.env.NODE_ENV = 'development';
4
4
  resolve();
5
5
  });
@@ -1,5 +1,5 @@
1
1
  const setEnvProd = () => {
2
- return new Promise((resolve) => {
2
+ return new Promise(resolve => {
3
3
  process.env.NODE_ENV = 'production';
4
4
  resolve();
5
5
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@changke/staticnext-build",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "Build scripts extracted from StaticNext seed project",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -20,6 +20,7 @@
20
20
  "type": "module",
21
21
  "devDependencies": {
22
22
  "@eslint/js": "^9.10.0",
23
+ "@stylistic/eslint-plugin": "^2.8.0",
23
24
  "eslint": "^9.10.0",
24
25
  "globals": "^15.9.0",
25
26
  "mocha": "^10.7.3"