Skip to content

Commit ae34743

Browse files
Upgrade linting dependencies (#11)
* Upgrade linting dependencies * Upgrade to eslint 10
1 parent 802184d commit ae34743

9 files changed

Lines changed: 104 additions & 288 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
This repository contains the code for Serverless Framework Compose.
22

3-
Requires Node.js `^20.19.0 || >=22.12.0`.
3+
Requires Node.js `^20.19.0 || ^22.13.0 || >=24`.
44

55
There is no standalone binary version, the package is only available via NPM.
66

components/framework/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,8 @@ class ServerlessFramework {
221221
stdoutResult = stdoutBuffer.toString();
222222
} catch (e) {
223223
throw new Error(
224-
'Could not find the Serverless Framework CLI installation. Ensure Serverless Framework is installed before continuing.\nhttps://github.com/oss-serverless/serverless'
224+
'Could not find the Serverless Framework CLI installation. Ensure Serverless Framework is installed before continuing.\nhttps://github.com/oss-serverless/serverless',
225+
{ cause: e }
225226
);
226227
}
227228
let matchResult = stdoutResult.match(/Framework Core: ([0-9]+\.[0-9]+\.[0-9]+)/);

eslint.config.js

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
'use strict';
2+
3+
const js = require('@eslint/js');
4+
const globals = require('globals');
5+
const importX = require('eslint-plugin-import-x');
6+
const n = require('eslint-plugin-n');
7+
const eslintConfigPrettier = require('eslint-config-prettier/flat');
8+
9+
const devDependencyFiles = [
10+
'**/*.test.js',
11+
'**/scripts/**',
12+
'**/test/**',
13+
'**/tests/**',
14+
'eslint.config.js',
15+
'prettier.config.js',
16+
];
17+
18+
module.exports = [
19+
{
20+
linterOptions: {
21+
reportUnusedDisableDirectives: 'warn',
22+
},
23+
},
24+
{
25+
ignores: ['**/.*'],
26+
},
27+
js.configs.recommended,
28+
n.configs['flat/recommended-script'],
29+
importX.flatConfigs.recommended,
30+
eslintConfigPrettier,
31+
{
32+
files: ['**/*.{cjs,js,mjs}'],
33+
languageOptions: {
34+
ecmaVersion: 2023,
35+
sourceType: 'commonjs',
36+
globals: {
37+
...globals.node,
38+
fetch: 'readonly',
39+
},
40+
},
41+
rules: {
42+
'import-x/no-extraneous-dependencies': [
43+
'error',
44+
{
45+
devDependencies: devDependencyFiles,
46+
},
47+
],
48+
'import-x/no-unresolved': ['error', { commonjs: true }],
49+
'no-unused-vars': ['error', { caughtErrors: 'none' }],
50+
'n/no-unsupported-features/node-builtins': ['error', { allowExperimental: true }],
51+
'n/no-extraneous-require': 'off',
52+
'n/no-unpublished-require': 'off',
53+
'n/no-missing-require': 'off',
54+
'n/no-process-exit': 'off',
55+
'n/no-deprecated-api': 'off',
56+
'n/hashbang': 'off',
57+
},
58+
},
59+
{
60+
files: ['**/*.mjs'],
61+
languageOptions: {
62+
sourceType: 'module',
63+
},
64+
},
65+
{
66+
files: ['**/*.test.js', '**/test/**'],
67+
languageOptions: {
68+
globals: globals.mocha,
69+
},
70+
rules: {
71+
'no-unused-expressions': 'off',
72+
},
73+
},
74+
];

0 commit comments

Comments
 (0)