Skip to content

Commit

Permalink
🎉 Init
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthieuLemoine committed Oct 7, 2018
0 parents commit 29d4831
Show file tree
Hide file tree
Showing 13 changed files with 5,171 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2
jobs:
build:
docker:
- image: circleci/node:10.11.0
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
- run: yarn install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
- run: yarn lint
- run: yarn pretty-check
- run: yarn test
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
17 changes: 17 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"extends": ["airbnb-base"],
"parserOptions": {
"ecmaVersion": 9
},
"env": {
"jest": true,
"node": true
},
"rules": {
"no-underscore-dangle": 0,
"no-use-before-define": [
"error",
{ "functions": false, "classes": true, "variables": true }
]
}
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.npmrc
10 changes: 10 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
node_modules
__tests__
.circleci
.git
examples
.eslintignore
.eslintrc
.gitignore
.prettierignore
.prettierrc
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
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"
}
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Remnants [![CircleCI](https://circleci.com/gh/MatthieuLemoine/remnants/tree/master.svg?style=svg)](https://circleci.com/gh/MatthieuLemoine/remnants/tree/master)

Find unused files. Spot these residues, leftovers, relics of an ancient past.

And :fire: them. Death to legacy & dead code :skull:

## Is it for me ?

:recycle: Did you recently refactor parts of your awesome project ? ✅

🧓 Is your project so old (more than 2 months old) that you can't even remember why some files exist ? ✅

🏭 Is your project so bloated that you're afraid to delete a file ? ✅

**Remnants** find those relics for you so than you can :fire: them in peace.

## Universal

Can be used with webpack, Metro, Rollup (& more) bundled projects but also good old unbundled Node projects.

## Install

```
yarn global add remnants
or
npm i -g remnants
```

## Usage

In your project directory

```
remnants
```

## Advance usage

```
remnants
```

## Related

If you're looking for a webpack plugin, give [unused-webpack-plugin](https://github.com/MatthieuLemoine/unused-webpack-plugin) a try. #shamelessplug
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/* eslint-disable */
require = require('esm')(module);
module.exports = require('./src/index');
16 changes: 16 additions & 0 deletions jest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env node
/* eslint-disable */
const jestRuntime = require('jest-runtime');

const oldexecModule = jestRuntime.prototype._execModule;

jestRuntime.prototype._execModule = function _execModule(localModule, options) {
// Do not apply esm to dependencies & test files to have access to jest globals
if (localModule.id.includes('node_modules') || localModule.id.includes('__tests__')) {
return oldexecModule.apply(this, [localModule, options]);
}
localModule.exports = require('esm')(localModule)(localModule.id);
return localModule;
};

cli = require('jest/bin/jest');
46 changes: 46 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "remnants",
"version": "1.0.0",
"description": "Find unused files. Spot these residues, leftovers, relics of an ancient past.",
"main": "index.js",
"module": "src/index.js",
"repository": "https://github.com/MatthieuLemoine/remnants",
"author": "MatthieuLemoine",
"license": "MIT",
"dependencies": {},
"devDependencies": {
"eslint": "^5.6.1",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-plugin-import": "^2.14.0",
"husky": "^1.1.1",
"jest": "^23.6.0",
"lint-staged": "^7.3.0",
"prettier": "^1.14.3",
"prettier-eslint-cli": "^4.7.1"
},
"scripts": {
"test": "./jest.js",
"lint": "eslint .",
"prettify": "prettier-eslint --write \"**/*.js*\" --list-different",
"pretty-check": "prettier-eslint \"**/*.js*\" --list-different",
"check-version": "node scripts/check-version.js"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"linters": {
"*.js": [
"prettier-eslint --write --config .prettierrc",
"eslint --fix",
"git add"
],
"*.json": [
"prettier-eslint --write --config .prettierrc",
"git add"
]
}
}
}
Empty file added src/index.js
Empty file.
Loading

0 comments on commit 29d4831

Please sign in to comment.