diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..9936782 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,20 @@ +{ + "env": { + "node": true, + "es2021": true, + "jest": true + }, + "extends": [ + "eslint:recommended" + ], + "parserOptions": { + "ecmaVersion": 12, + "sourceType": "module" + }, + "rules": { + "no-console": "warn", + "semi": ["error", "always"], + "quotes": ["error", "single"], + "indent": ["error", 2] + } +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 74ca64e..941c148 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,9 @@ node_modules/ -docs/ -npm-debug.log +dist/ +*.log +.env +.DS_Store +coverage/ +.nyc_output/ +.vscode/ +.idea/ \ No newline at end of file diff --git a/package.json b/package.json index 5aa2568..cbf75cc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "osmosis", - "version": "1.1.10", + "name": "node-osmosis", + "version": "1.1.11", "description": "Web scraper for NodeJS", "keywords": [ "web", @@ -24,19 +24,38 @@ "needle": "^1.6.0" }, "devDependencies": { - "jscs": ">=3.0.2", - "nodeunit": "0.11.3" + "@types/node": "^18.15.0", + "eslint": "^8.36.0", + "eslint-config-recommended": "^4.1.0", + "jest": "^29.5.0", + "ts-node": "^10.9.1", + "typescript": "^4.9.5" }, "scripts": { - "test": "node ./node_modules/.bin/nodeunit test" + "test": "jest", + "lint": "eslint . --ext .js,.ts", + "lint:fix": "eslint . --ext .js,.ts --fix", + "prepare": "tsc", + "clean": "rm -rf dist" }, "license": "MIT", - "main": "index", + "main": "dist/index.js", + "types": "dist/index.d.ts", "engines": { - "node": ">= 0.8.0" + "node": ">= 14.0.0" }, "readmeFilename": "Readme.md", "bugs": { "url": "https://github.com/rchipka/node-osmosis/issues" + }, + "jest": { + "testEnvironment": "node", + "transform": {} + }, + "eslintConfig": { + "extends": "recommended", + "rules": { + "no-console": "off" + } } -} +} \ No newline at end of file diff --git a/test/basic.test.js b/test/basic.test.js new file mode 100644 index 0000000..111dc44 --- /dev/null +++ b/test/basic.test.js @@ -0,0 +1,5 @@ +describe('Project Configuration', () => { + test('Basic test setup works', () => { + expect(true).toBe(true); + }); +}); \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..83c5197 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "target": "es2020", + "module": "commonjs", + "lib": ["es2020"], + "declaration": true, + "outDir": "./dist", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true + }, + "include": ["lib/**/*"], + "exclude": ["node_modules", "dist"] +} \ No newline at end of file