@haltcase/style 4.0.0 → 4.1.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.
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ const {
4
+ levels: { error },
5
+ astroFiles
6
+ } = require("./constants");
7
+ const checkForPackage = require("./utils/require-package");
8
+
9
+ checkForPackage("astro", "eslint-plugin-astro");
10
+
11
+ module.exports = {
12
+ extends: ["plugin:astro/recommended"],
13
+ overrides: [
14
+ {
15
+ files: astroFiles,
16
+ parser: "astro-eslint-parser",
17
+ parserOptions: {
18
+ parser: "@typescript-eslint/parser",
19
+ extraFileExtensions: [".astro"]
20
+ },
21
+ rules: {
22
+ // override/add rules settings here, such as:
23
+ // "astro/no-set-html-directive": "error"
24
+ }
25
+ },
26
+ {
27
+ files: ["./src/env.d.ts"],
28
+ rules: {
29
+ "unicorn/prevent-abbreviations": [
30
+ error,
31
+ {
32
+ allowList: {
33
+ env: true
34
+ }
35
+ }
36
+ ]
37
+ }
38
+ }
39
+ ]
40
+ };
@@ -18,6 +18,8 @@ module.exports = {
18
18
  nextJsPageFiles: ["**/{pages,app}/**/*.{m,}{js,ts}x"],
19
19
  nextJsApiRoutes: ["**/{pages,app}/api/**/*.{m,}{js,ts}"],
20
20
 
21
+ astroFiles: ["*.astro"],
22
+
21
23
  commonJsOverrides: {
22
24
  parserOptions: {
23
25
  sourceType: "script"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haltcase/style",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "description": "haltcase's web ecosystem style guide & configurations",
5
5
  "keywords": [
6
6
  "eslint",
@@ -74,6 +74,7 @@
74
74
  "eslint-plugin-testing-library": "^6.1.0",
75
75
  "eslint-plugin-tsdoc": "^0.2.17",
76
76
  "eslint-plugin-unicorn": "^48.0.1",
77
+ "prettier-plugin-astro": "^0.12.1",
77
78
  "prettier-plugin-packagejson": "^2.4.6"
78
79
  },
79
80
  "devDependencies": {
@@ -105,6 +106,9 @@
105
106
  "eslint": {
106
107
  "optional": true
107
108
  },
109
+ "eslint-plugin-astro": {
110
+ "optional": true
111
+ },
108
112
  "prettier": {
109
113
  "optional": true
110
114
  },
package/prettier/index.js CHANGED
@@ -17,5 +17,13 @@ module.exports = {
17
17
  ...overridableDefaults,
18
18
  singleQuote: false,
19
19
  trailingComma: "none",
20
- plugins: ["prettier-plugin-packagejson"]
20
+ plugins: ["prettier-plugin-astro", "prettier-plugin-packagejson"],
21
+ overrides: [
22
+ {
23
+ files: "*.astro",
24
+ options: {
25
+ parser: "astro"
26
+ }
27
+ }
28
+ ]
21
29
  };