Skip to content

Commit

Permalink
Merge pull request #9 from teslitsky/chore/migrate-to-eslint-v9
Browse files Browse the repository at this point in the history
Migrate to ESLint v9
  • Loading branch information
teslitsky authored Oct 1, 2024
2 parents 3842109 + d672e91 commit 9bafc18
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 22 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"
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

[![Build Status](https://travis-ci.org/teslitsky/mongoose-imei.svg?branch=master)](https://travis-ci.org/teslitsky/mongoose-imei)

Gives you the `Imei` type to use in your schemas, complete with validation using [node-imei](https://github.com/B2MSolutions/node-imei) library. https://en.wikipedia.org/wiki/International_Mobile_Equipment_Identity
Gives you the `Imei` type to use in your schemas, complete with validation using [node-imei](https://www.npmjs.com/package/node-imei) library. https://en.wikipedia.org/wiki/International_Mobile_Equipment_Identity

## Usage

Start with an `npm install --save mongoose-imei`
Start with an `npm install mongoose-imei`

```javascript
const mongoose = require('mongoose');
Expand Down
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 9bafc18

Please sign in to comment.