@open-xchange/linter-presets 0.1.3 → 0.1.4
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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import eslintJs from "@eslint/js";
|
|
2
|
+
import babelParser from "@babel/eslint-parser";
|
|
2
3
|
// functions ==================================================================
|
|
3
4
|
/**
|
|
4
5
|
* Defines standard module settings and additional rules targeting JavaScript
|
|
@@ -18,7 +19,7 @@ export default function base(options) {
|
|
|
18
19
|
const languageOptions = (sourceType, ...extensions) => {
|
|
19
20
|
const { ecmaVersion } = options;
|
|
20
21
|
return {
|
|
21
|
-
files: extensions.map(ext => "
|
|
22
|
+
files: extensions.map(ext => "**/*." + ext),
|
|
22
23
|
languageOptions: { ecmaVersion, sourceType },
|
|
23
24
|
};
|
|
24
25
|
};
|
|
@@ -36,6 +37,23 @@ export default function base(options) {
|
|
|
36
37
|
languageOptions("commonjs", "cjs", "cts"),
|
|
37
38
|
// ECMA version and module type for *.js and *.ts files
|
|
38
39
|
languageOptions(options.sourceType, "js", "jsx", "ts", "tsx"),
|
|
40
|
+
// ECMA decorators via Babel plugin
|
|
41
|
+
...(options.nativeDecorators ? [{
|
|
42
|
+
files: ["**/*.{js,jsx,mjs,cjs}"],
|
|
43
|
+
languageOptions: {
|
|
44
|
+
parser: babelParser,
|
|
45
|
+
parserOptions: {
|
|
46
|
+
requireConfigFile: false,
|
|
47
|
+
babelOptions: {
|
|
48
|
+
babelrc: false,
|
|
49
|
+
configFile: false,
|
|
50
|
+
plugins: [
|
|
51
|
+
["@babel/plugin-proposal-decorators", { version: "2023-11" }],
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
}] : []),
|
|
39
57
|
// configure linter rules
|
|
40
58
|
{
|
|
41
59
|
files: ["**/*.{js,jsx,mjs,cjs,ts,tsx,mts,cts}"],
|
package/dist/eslint/index.js
CHANGED
|
@@ -17,6 +17,12 @@ export interface LanguageOptions {
|
|
|
17
17
|
* Default value is "module".
|
|
18
18
|
*/
|
|
19
19
|
sourceType?: "module" | "commonjs";
|
|
20
|
+
/**
|
|
21
|
+
* Whether to support native ES decorators in JavaScript code (via Babel
|
|
22
|
+
* plugin). Does not affect TypeScript code which uses an own parser aware
|
|
23
|
+
* of the decorator syntax. Default value is `false`.
|
|
24
|
+
*/
|
|
25
|
+
nativeDecorators?: boolean;
|
|
20
26
|
}
|
|
21
27
|
/**
|
|
22
28
|
* Configuration options for code style.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "@open-xchange/linter-presets",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.4",
|
|
5
5
|
"description": "Configuration presets for ESLint and StyleLint",
|
|
6
6
|
"repository": {
|
|
7
7
|
"url": "https://gitlab.open-xchange.com/fspd/npm-packages/linter-presets"
|
|
@@ -23,6 +23,9 @@
|
|
|
23
23
|
"*.{js,ts,json}": "yarn lint"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
+
"@babel/core": "7.24.8",
|
|
27
|
+
"@babel/eslint-parser": "7.24.8",
|
|
28
|
+
"@babel/plugin-proposal-decorators": "7.24.7",
|
|
26
29
|
"@eslint-community/eslint-plugin-eslint-comments": "4.3.0",
|
|
27
30
|
"@eslint/compat": "1.1.1",
|
|
28
31
|
"@eslint/js": "9.7.0",
|