You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by er...@apache.org on 2025/07/17 10:59:48 UTC
(cordova-eslint) 01/01: fix: correct usage to be sharable
This is an automated email from the ASF dual-hosted git repository.
erisu pushed a commit to branch fix/eslint-9-sharable
in repository https://gitbox.apache.org/repos/asf/cordova-eslint.git
commit c0cb73bfd40a59ec68e739f5e0b5aef16dd571fc
Author: Erisu <er...@apache.org>
AuthorDate: Thu Jul 17 19:49:47 2025 +0900
fix: correct usage to be sharable
---
browser-tests.js | 15 ++++++++++-----
browser.js | 12 ++++++++----
index.js | 7 ++++++-
lib/base.js | 2 +-
node-tests.js | 15 ++++++++++-----
node.js | 12 ++++++++----
spec/e2e.spec.js | 4 ++--
7 files changed, 45 insertions(+), 22 deletions(-)
diff --git a/browser-tests.js b/browser-tests.js
index 8cc5104..e645305 100644
--- a/browser-tests.js
+++ b/browser-tests.js
@@ -17,8 +17,13 @@
under the License.
*/
-module.exports = [
- require('./lib/base.js'),
- require('./lib/browser.js'),
- require('./lib/tests.js')
-];
+const { defineConfig } = require('eslint/config');
+const base = require('./lib/base.js');
+const browser = require('./lib/browser.js');
+const tests = require('./lib/tests.js');
+
+module.exports = defineConfig([
+ { ...base },
+ { ...browser },
+ { ...tests }
+]);
diff --git a/browser.js b/browser.js
index 1d1f25c..40c43b3 100644
--- a/browser.js
+++ b/browser.js
@@ -17,7 +17,11 @@
under the License.
*/
-module.exports = [
- require('./lib/base.js'),
- require('./lib/browser.js')
-];
+const { defineConfig } = require('eslint/config');
+const base = require('./lib/base.js');
+const browser = require('./lib/browser.js');
+
+module.exports = defineConfig([
+ { ...base },
+ { ...browser }
+]);
diff --git a/index.js b/index.js
index e9c8891..272cf21 100644
--- a/index.js
+++ b/index.js
@@ -17,4 +17,9 @@
under the License.
*/
-module.exports = require('./node.js');
+const { defineConfig } = require('eslint/config');
+const node = require('./lib/node.js');
+
+module.exports = defineConfig([
+ { ...node }
+]);
diff --git a/lib/base.js b/lib/base.js
index 22e973e..452c88b 100644
--- a/lib/base.js
+++ b/lib/base.js
@@ -30,7 +30,7 @@ module.exports = {
plugins: {
n: require('eslint-plugin-n'),
promise: require('eslint-plugin-promise'),
- import: require('eslint-plugin-import')
+ import: require('eslint-plugin-import'),
},
rules: {
diff --git a/node-tests.js b/node-tests.js
index be0ceee..ff026ab 100644
--- a/node-tests.js
+++ b/node-tests.js
@@ -17,8 +17,13 @@
under the License.
*/
-module.exports = [
- require('./lib/base.js'),
- require('./lib/node.js'),
- require('./lib/tests.js')
-];
+const { defineConfig } = require('eslint/config');
+const base = require('./lib/base.js');
+const node = require('./lib/node.js');
+const tests = require('./lib/tests.js');
+
+module.exports = defineConfig([
+ { ...base },
+ { ...node },
+ { ...tests }
+]);
diff --git a/node.js b/node.js
index e0dad8f..477701b 100644
--- a/node.js
+++ b/node.js
@@ -17,7 +17,11 @@
under the License.
*/
-module.exports = [
- require('./lib/base.js'),
- require('./lib/node.js')
-];
+const { defineConfig } = require('eslint/config');
+const base = require('./lib/base.js');
+const node = require('./lib/node.js');
+
+module.exports = defineConfig([
+ { ...base },
+ { ...node }
+]);
diff --git a/spec/e2e.spec.js b/spec/e2e.spec.js
index c43074e..3f25a63 100644
--- a/spec/e2e.spec.js
+++ b/spec/e2e.spec.js
@@ -18,10 +18,10 @@
*/
const path = require('path');
-const ESLint = require('eslint').ESLint;
+const { ESLint } = require('eslint');
describe('Cordova ESLint configuration', () => {
- const configs = ['index', 'node-tests', 'browser', 'browser-tests'];
+ const configs = ['index', 'node', 'node-tests', 'browser', 'browser-tests'];
for (const config of configs) {
it(`loads config "${config}" without throwing`, () => {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org