aberlaas-lint 2.25.0 → 2.26.0

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.
@@ -19,6 +19,7 @@ export default [
19
19
  processor: 'vue/vue',
20
20
  rules: {
21
21
  ...rules,
22
+ 'vue/attribute-hyphenation': ['error', 'never'],
22
23
  'vue/component-api-style': ['error', ['script-setup']],
23
24
  'vue/define-macros-order': ['error'],
24
25
 
@@ -5,7 +5,7 @@ export default {
5
5
  'at-rule-no-unknown': [
6
6
  true,
7
7
  {
8
- ignoreAtRules: ['screen', 'tailwind'],
8
+ ignoreAtRules: ['screen', 'tailwind', 'theme'],
9
9
  },
10
10
  ],
11
11
  'block-no-empty': true,
package/lib/css.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { _ } from 'golgoth';
2
2
  import { firostError } from 'firost';
3
- import { findHostPackageFiles, getConfig } from 'aberlaas-helper';
3
+ import { findHostFiles, getConfig } from 'aberlaas-helper';
4
4
  import stylelint from 'stylelint';
5
5
  import stylelintConfig from '../configs/stylelint.js';
6
6
  import { prettierFix } from './helpers/prettierFix.js';
@@ -72,7 +72,7 @@ __ = {
72
72
  const filePatterns = _.isEmpty(userPatterns)
73
73
  ? ['./**/*.css']
74
74
  : userPatterns;
75
- return await findHostPackageFiles(filePatterns, ['.css']);
75
+ return await findHostFiles(filePatterns, ['.css']);
76
76
  },
77
77
 
78
78
  prettierFix,
@@ -2,6 +2,7 @@ import { _, pMap } from 'golgoth';
2
2
  import { firostError, read, write } from 'firost';
3
3
  import { getConfig } from 'aberlaas-helper';
4
4
  import { format as prettierFormat } from 'prettier';
5
+ import * as prettierTailwindPlugin from 'prettier-plugin-tailwindcss';
5
6
  import prettierConfig from '../../configs/prettier.js';
6
7
 
7
8
  /**
@@ -12,6 +13,9 @@ export async function prettierFix(inputFiles) {
12
13
  // Config file
13
14
  const config = await getConfig(null, 'prettier.config.js', prettierConfig);
14
15
 
16
+ // Plugins
17
+ const plugins = [prettierTailwindPlugin];
18
+
15
19
  const errors = [];
16
20
 
17
21
  // Read all files, run them through the formatter and save them back to disk
@@ -21,7 +25,7 @@ export async function prettierFix(inputFiles) {
21
25
  async (filepath) => {
22
26
  try {
23
27
  const content = await read(filepath);
24
- const options = { ...config, filepath };
28
+ const options = { ...config, plugins, filepath };
25
29
  const result = await prettierFormat(content, options);
26
30
  await write(result, filepath);
27
31
  } catch (error) {
package/lib/html.js ADDED
@@ -0,0 +1,48 @@
1
+ import { _ } from 'golgoth';
2
+ import { findHostFiles } from 'aberlaas-helper';
3
+ import { prettierFix } from './helpers/prettierFix.js';
4
+
5
+ export let __;
6
+
7
+ /**
8
+ * Lint HTML files
9
+ * @returns {boolean} True on success
10
+ */
11
+ export async function run() {
12
+ // We do not currently have an HTML Linter, only a Formatter
13
+ return true;
14
+ }
15
+
16
+ /**
17
+ * Autofix HTML files in place
18
+ * @param {Array} userPatterns Patterns to narrow the search down
19
+ * @returns {boolean} True on success
20
+ */
21
+ export async function fix(userPatterns) {
22
+ const files = await __.getInputFiles(userPatterns);
23
+ if (_.isEmpty(files)) {
24
+ return true;
25
+ }
26
+ await __.prettierFix(files);
27
+ }
28
+
29
+ __ = {
30
+ /**
31
+ * Find all relevant HTML files
32
+ * @param {Array} userPatterns Patterns to narrow the search down
33
+ * @returns {Array} Array of files
34
+ */
35
+ async getInputFiles(userPatterns) {
36
+ const filePatterns = _.isEmpty(userPatterns)
37
+ ? ['./**/*.html']
38
+ : userPatterns;
39
+ return await findHostFiles(filePatterns, ['.html']);
40
+ },
41
+
42
+ prettierFix,
43
+ };
44
+
45
+ export default {
46
+ run,
47
+ fix,
48
+ };
package/lib/js.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { _ } from 'golgoth';
2
2
  import { firostError } from 'firost';
3
- import { findHostPackageFiles } from 'aberlaas-helper';
3
+ import { findHostFiles } from 'aberlaas-helper';
4
4
  import { eslintRun } from './helpers/eslintRun.js';
5
5
 
6
6
  export let __;
@@ -45,7 +45,7 @@ __ = {
45
45
  : userPatterns;
46
46
  const allowedExtensions = ['.js', '.jsx', '.ts', '.tsx', '.vue'];
47
47
 
48
- return await findHostPackageFiles(filePatterns, allowedExtensions);
48
+ return await findHostFiles(filePatterns, allowedExtensions);
49
49
  },
50
50
  };
51
51
 
package/lib/json.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { _ } from 'golgoth';
2
2
  import { firostError } from 'firost';
3
- import { findHostPackageFiles } from 'aberlaas-helper';
3
+ import { findHostFiles } from 'aberlaas-helper';
4
4
  import { eslintRun } from './helpers/eslintRun.js';
5
5
  import { prettierFix } from './helpers/prettierFix.js';
6
6
 
@@ -57,7 +57,7 @@ __ = {
57
57
  const filePatterns = _.isEmpty(userPatterns)
58
58
  ? ['./**/*.json']
59
59
  : userPatterns;
60
- return await findHostPackageFiles(filePatterns, ['.json']);
60
+ return await findHostFiles(filePatterns, ['.json']);
61
61
  },
62
62
 
63
63
  prettierFix,
package/lib/main.js CHANGED
@@ -55,6 +55,7 @@ __ = {
55
55
  linters: {
56
56
  circleci: './circleci.js',
57
57
  css: './css.js',
58
+ html: './html.js',
58
59
  json: './json.js',
59
60
  js: './js.js',
60
61
  yml: './yml.js',
package/lib/yml.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import path from 'node:path';
2
2
  import { _, pMap } from 'golgoth';
3
3
  import { firostError, read } from 'firost';
4
- import { findHostPackageFiles, hostGitRoot } from 'aberlaas-helper';
4
+ import { findHostFiles, hostGitRoot } from 'aberlaas-helper';
5
5
  import yamlLint from 'yaml-lint';
6
6
  import { prettierFix } from './helpers/prettierFix.js';
7
7
 
@@ -61,7 +61,7 @@ __ = {
61
61
  const filePatterns = _.isEmpty(userPatterns)
62
62
  ? ['./**/*.yml', './**/*.yaml']
63
63
  : userPatterns;
64
- return await findHostPackageFiles(filePatterns, ['.yml', '.yaml']);
64
+ return await findHostFiles(filePatterns, ['.yml', '.yaml']);
65
65
  },
66
66
 
67
67
  prettierFix,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aberlaas-lint",
3
- "version": "2.25.0",
3
+ "version": "2.26.0",
4
4
  "type": "module",
5
5
  "description": "aberlaas lint command: Lint files",
6
6
  "author": "Tim Carry <tim@pixelastic.com>",
@@ -29,8 +29,8 @@
29
29
  "@eslint/json": "1.0.0",
30
30
  "@typescript-eslint/utils": "8.55.0",
31
31
  "@vitest/eslint-plugin": "1.6.7",
32
- "aberlaas-helper": "2.25.0",
33
- "aberlaas-versions": "2.25.0",
32
+ "aberlaas-helper": "2.26.0",
33
+ "aberlaas-versions": "2.26.0",
34
34
  "ci-info": "4.4.0",
35
35
  "eslint": "9.39.2",
36
36
  "eslint-config-prettier": "10.1.8",
@@ -46,6 +46,7 @@
46
46
  "golgoth": "3.1.0",
47
47
  "jsonc-eslint-parser": "2.4.2",
48
48
  "prettier": "3.8.1",
49
+ "prettier-plugin-tailwindcss": "0.7.2",
49
50
  "stylelint": "17.2.0",
50
51
  "typescript": "5.9.3",
51
52
  "vue-eslint-parser": "10.4.0",