Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 20 additions & 13 deletions .eslintrc.js → eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
var google = require('eslint-config-google');

// The ESLint ecmaVersion argument is inconsistently used. Some rules will ignore it entirely, so if the rule has
// been set, it will still error even if it's not applicable to that version number. Since Google sets these
// rules, we have to turn them off ourselves.
Expand Down Expand Up @@ -44,21 +46,26 @@ var SHAREDB_RULES = {
// as-needed quote props are easier to write
'quote-props': ['error', 'as-needed'
],
// Google still enables these, but ESLint removed them from core, so turning them off keeps the config loadable
'require-jsdoc': 'off',
'valid-jsdoc': 'off'
};

module.exports = {
extends: 'google',
parserOptions: {
ecmaVersion: 3
module.exports = [
{
ignores: ['docs/', 'coverage/']
},
rules: Object.assign(
{},
DISABLED_ES6_OPTIONS,
SHAREDB_RULES
),
ignorePatterns: [
'/docs/'
]
};
{
files: ['**/*.js'],
languageOptions: {
ecmaVersion: 3,
sourceType: 'commonjs'
},
rules: Object.assign(
{},
google.rules,
DISABLED_ES6_OPTIONS,
SHAREDB_RULES
)
}
];
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "In-memory database adapter with MongoDB API for ShareDB",
"main": "index.js",
"scripts": {
"lint": "./node_modules/.bin/eslint --ignore-path .gitignore '**/*.js'",
"lint": "./node_modules/.bin/eslint .",
"lint:fix": "npm run lint -- --fix",
"test": "mocha",
"test-cover": "node_modules/nyc/bin/nyc.js --temp-dir=coverage -r text -r lcov node_modules/mocha/bin/_mocha"
Expand All @@ -25,7 +25,7 @@
"async": "^3.2.3",
"chai": "^6.2.2",
"coveralls": "^3.0.7",
"eslint": "^7.32.0",
"eslint": "^10.5.0",
"eslint-config-google": "^0.14.0",
"mocha": "^6.2.2",
"nyc": "^18.0.0",
Expand Down
Loading