Skip to content

Commit

Permalink
Update ESLint rules
Browse files Browse the repository at this point in the history
- bump ESLint to v9
- remove eslint-config-airbnb-base
- remove eslint-plugin-import
- move Prettier and ESLint configs from package.json
  • Loading branch information
teslitsky committed Oct 1, 2024
1 parent 0f2a814 commit d672e91
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 20 deletions.
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "all"
}
24 changes: 24 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const pluginJs = require('@eslint/js');
const globals = require('globals');
const eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended');

module.exports = [
pluginJs.configs.recommended,
eslintPluginPrettierRecommended,
{
languageOptions: { globals: globals.node },
},
{
files: ['**/*.js'],
languageOptions: { sourceType: 'commonjs' },
},
{
files: ['**/*.spec.js'],
languageOptions: {
globals: {
...globals.node,
...globals.jest,
},
},
},
];
1 change: 0 additions & 1 deletion lib/mongoose-imei.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-param-reassign */
const ImeiType = require('./imei-type');

function loadType(mongoose) {
Expand Down
25 changes: 6 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "Mongoose type for IMEI",
"main": "index.js",
"scripts": {
"test": "jest tests/*.spec.js"
"test": "jest tests/*.spec.js",
"lint": "eslint"
},
"repository": {
"type": "git",
Expand All @@ -26,27 +27,13 @@
"url": "https://github.com/teslitsky/mongoose-imei/issues"
},
"homepage": "https://github.com/teslitsky/mongoose-imei#readme",
"eslintConfig": {
"root": true,
"env": {
"node": true,
"jest": true
},
"extends": [
"airbnb-base",
"prettier"
]
},
"prettier": {
"trailingComma": "all",
"singleQuote": true
},
"devDependencies": {
"@eslint/js": "9.11.1",
"@types/jest": "29.5.13",
"eslint": "8.26.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint": "9.11.1",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-import": "2.30.0",
"eslint-plugin-prettier": "5.2.1",
"globals": "15.9.0",
"jest": "29.7.0",
"mongodb-memory-server": "10.0.1",
"mongoose": "8.7.0",
Expand Down

0 comments on commit d672e91

Please sign in to comment.