{"id":14987891,"url":"https://github.com/apache/cordova-eslint","last_synced_at":"2025-10-19T11:32:46.027Z","repository":{"id":35990466,"uuid":"216627287","full_name":"apache/cordova-eslint","owner":"apache","description":"Apache Cordova - ESLint","archived":false,"fork":false,"pushed_at":"2024-11-18T22:46:07.000Z","size":352,"stargazers_count":6,"open_issues_count":1,"forks_count":6,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-01-30T10:34:33.607Z","etag":null,"topics":["cordova","eslint","javascript"],"latest_commit_sha":null,"homepage":"https://cordova.apache.org/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apache.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-21T17:34:10.000Z","updated_at":"2024-08-03T06:01:58.000Z","dependencies_parsed_at":"2024-01-25T23:05:44.490Z","dependency_job_id":"6c762053-ca56-4360-b062-1c03b96a4050","html_url":"https://github.com/apache/cordova-eslint","commit_stats":{"total_commits":50,"total_committers":6,"mean_commits":8.333333333333334,"dds":0.48,"last_synced_commit":"64112db0cc312457867b355c4b0d0eec329619bc"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fcordova-eslint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fcordova-eslint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fcordova-eslint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fcordova-eslint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apache","download_url":"https://codeload.github.com/apache/cordova-eslint/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237125473,"owners_count":19259291,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cordova","eslint","javascript"],"created_at":"2024-09-24T14:15:39.333Z","updated_at":"2025-10-19T11:32:46.022Z","avatar_url":"https://github.com/apache.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\n#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements.  See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership.  The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License.  You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied.  See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#\n--\u003e\n\n# @cordova/eslint-config\n\n[![NPM](https://nodei.co/npm/@cordova/eslint-config.svg?style=flat\u0026data=n,v,u\u0026color=blue)](https://www.npmjs.com/package/@cordova/eslint-config)\n\n[![Node CI](https://github.com/apache/cordova-eslint/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/apache/cordova-eslint/actions/workflows/ci.yml?query=branch%3Amaster)\n[![Release Audit](https://github.com/apache/cordova-eslint/actions/workflows/release-audit.yml/badge.svg?branch=master)](https://github.com/apache/cordova-eslint/actions/workflows/release-audit.yml?query=branch%3Amaster)\n[![codecov.io](https://codecov.io/github/apache/cordova-eslint/coverage.svg?branch=master)](https://codecov.io/github/apache/cordova-eslint?branch=master)\n\nThis repository centralizes the ESLint configuration used for Cordova's development, specifically repositories that start with `apache/cordova-`.\n\n## Installation\n\n`@cordova/eslint-config` comes with all plugins configs and even `eslint` itself. So all you need to do to get started is:\n\n```shell\nnpm i -D @cordova/eslint-config\n```\n\n## Usage\n\n```yml\n# In package.json\n{\n  \"scripts\": {\n    \"lint\": \"eslint\"\n  }\n}\n```\n\n```javascript\n// In eslint.config.js\nconst { defineConfig, globalIgnores } = require('eslint/config');\nconst nodeConfig = require('@cordova/eslint-config/node');\nconst nodeTestConfig = require('@cordova/eslint-config/node-tests');\nconst browserConfig = require('@cordova/eslint-config/browser');\n\nmodule.exports = defineConfig([\n    globalIgnores([\n        // Add files or folders to ignore...\n        // For example: exclude everything in the \"coverage\" directory.\n        'coverage'\n    ]),\n\n    // Node Linting\n    ...nodeConfig.map(config =\u003e ({\n        files: [\n            // Add files or folders to check...\n            // For example: include everything in the \"lib\" directory.\n            // By default, ESLint lints files with extensions .js, .mjs \u0026 .cjs.\n            'lib'\n        ],\n\n        // Spread each shared config to preserve its settings while extending or overriding specific properties\n        ...config\n    })),\n\n    // Node Test Linting\n    ...nodeTestConfig.map(config =\u003e ({\n        // Add files or folders to check...\n        // For example: include everything in the \"spec\" directory.\n        // By default, ESLint lints files with extensions .js, .mjs \u0026 .cjs.\n        files: [\n            'spec'\n        ],\n\n        // Spread each shared config to preserve its settings while extending or overriding specific properties\n        ...config,\n\n        // Overriding Rules\n        rules: {\n            // Make sure the original rules are applied\n            ...(config.rules || {}),\n\n            // Then append or update rules\n            'prefer-promise-reject-errors': 'off'\n        }\n    })),\n\n    // Browser Linting\n    ...browserConfig.map(config =\u003e ({\n        files: [\n            // Add files or folders to check...\n            // For Example: Platforms usuall has \"cordova-js-src\" that comiles down into a cordova.js file to runs in the app's WebView.\n            'cordova-js-src'\n        ],\n\n        // Spread each shared config to preserve its settings while extending or overriding specific properties\n        ...config,\n\n        // Overriding Language Options\n        languageOptions: {\n\n            // Make sure the original languageOptions are applied if existing\n            ...(config?.languageOptions || {}),\n\n            // Overriding Global\n            globals: {\n                // Make sure the original languageOptions.globals are applied\n                ...(config.languageOptions?.globals || {})\n\n                // Then append or update globals\n                require: 'readonly',\n                module: 'readonly',\n            }\n        }\n    }))\n]);\n```\n\n## Reference\n\nThis package exposes the following shareable ESLint configurations:\n\n### `@cordova/eslint-config/node` (or simply `@cordova`)\n\nFor linting scripts intended to be run with Node.js.\n\n### `@cordova/eslint-config/node-tests`\n\nFor linting Jasmine tests of Cordova's Node.js scripts.\n\n### `@cordova/eslint-config/browser`\n\nFor linting cordova-style CommonJS modules intended to be run in the browser (before they are bundled).\n\n### `@cordova/eslint-config/browser-tests`\n\nFor linting Jasmine tests of Cordova's browser code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fcordova-eslint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapache%2Fcordova-eslint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fcordova-eslint/lists"}