Skip to content

Commit

Permalink
2.4.0 (#64)
Browse files Browse the repository at this point in the history
* add a few common crusties to .gitignore

* dependencies updated, configs updated for new webpack-merge version

* converting old .rc files to .js

* another .rc -> .js conversion... updating readme to reflect

* comma dangles are back!

* prettier configs

* adding prettier dependencies for use w/ eslint

* adding prettier to eslint, removing some old relic rules

* change npm run dev to start (standard in 2020)

* adding info about prettier to readme

* minor version bump
  • Loading branch information
bstaruk committed Aug 13, 2020
1 parent 592fb82 commit a6566e7
Show file tree
Hide file tree
Showing 16 changed files with 2,848 additions and 1,355 deletions.
3 changes: 0 additions & 3 deletions .babelrc

This file was deleted.

24 changes: 0 additions & 24 deletions .eslintrc

This file was deleted.

29 changes: 29 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const fs = require('fs');
const path = require('path');

const prettierOptions = JSON.parse(
fs.readFileSync(path.resolve(__dirname, '.prettierrc'), 'utf8'),
);

module.exports = {
parser: 'babel-eslint',
extends: ['airbnb-base', 'prettier'],
plugins: ['import', 'prettier'],
rules: {
'prettier/prettier': ['error', prettierOptions],
'no-use-before-define': 0,
'import/no-extraneous-dependencies': 0,
},
globals: {
document: true,
window: true,
location: true,
},
settings: {
'import/resolver': {
webpack: {
config: 'webpack/webpack.config.base.js',
},
},
},
};
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
node_modules/
dist/
.DS_Store
.idea
npm-debug.log
node_modules
dist
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dist/
node_modules/
package-lock.json
yarn.lock
package.json
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "all"
}
13 changes: 0 additions & 13 deletions .stylelintrc

This file was deleted.

11 changes: 11 additions & 0 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
extends: 'stylelint-config-standard',
rules: {
'at-rule-no-unknown': [
true,
{
ignoreAtRules: ['extend'],
},
],
},
};
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ starbase is an offline-first web app boilerplate that is built with webpack 4, P

* [Node.js](https://github.com/nodejs/node)
* [webpack 4](https://github.com/webpack/webpack) & [webpack-dev-server](https://github.com/webpack/webpack-dev-server)
* [Babel 7](https://github.com/babel/babel) w/ [ESLint](https://github.com/eslint/eslint)
* [Babel 7](https://github.com/babel/babel) w/ [ESLint](https://github.com/eslint/eslint) & [Prettier](https://github.com/prettier/prettier)
* [PostCSS](https://github.com/postcss/postcss) w/
* [PostCSS Preset Env](https://github.com/csstools/postcss-preset-env)
* [PostCSS Nested](https://github.com/postcss/postcss-nested)
Expand Down Expand Up @@ -38,11 +38,11 @@ After completing the steps below, you will be ready to begin using starbase:

starbase uses [webpack-dev-server](https://github.com/webpack/webpack-dev-server) to serve up your project at [http://localhost:8080](http://localhost:8080) for streamlined and convenient development.

After running `npm run dev` in the project root, your `/src` code will be served at the url above and watched for changes. As you modify code in `/src`, the project will be recompiled and your browser will refresh to show the latest changes.
After running `npm run start` in the project root, your `/src` code will be served at the url above and watched for changes. As you modify code in `/src`, the project will be recompiled and your browser will refresh to show the latest changes.

```
cd /path/to/starbase
npm run dev
npm run start
```

### building for production
Expand Down Expand Up @@ -91,19 +91,24 @@ If you want to remove these for any reason, perform the following steps:

### javascript & css linting

starbase uses [ESLint](http://eslint.org/) for Javascript (ES6) linting and [stylelint](https://github.com/stylelint/stylelint) for CSS linting. The configs (`/.eslintrc` and `/.stylelintrc` respectively) included out of the box contain some basic common rules. Modify them to your liking to encourage consistent code throughout your project.
starbase uses [ESLint](http://eslint.org/) for Javascript (ES6) linting and [stylelint](https://github.com/stylelint/stylelint) for CSS linting. The configs (`/.eslintrc.js` and `/.stylelintrc.js` respectively) included out of the box contain some basic common rules. Modify them to your liking to encourage consistent code throughout your project.

#### airbnb eslint config

starbase enforces the [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript) with ESLint via [eslint-config-airbnb](https://www.npmjs.com/package/eslint-config-airbnb). These rules are basically the industry standard in 2017 so I'd recommend adhering to them, but you can override individual rules via the project `/.eslintrc` file. I've included a couple basic overrides (in `/.eslintrc`) to demonstrate usage.
starbase enforces the [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript) with ESLint via [eslint-config-airbnb](https://www.npmjs.com/package/eslint-config-airbnb). These rules are basically the industry standard in 2017 so I'd recommend adhering to them, but you can override individual rules via the project `/.eslintrc.js` file. I've included a couple basic overrides (in `/.eslintrc.js`) to demonstrate usage.

##### to remove the airbnb eslint config:

1. in `/.eslintrc`, remove the line that says `extends`
1. in `/.eslintrc.js`, remove the line that says `extends`
2. in `/package.json`, remove the `eslint-config-airbnb` dependency
3. run `npm update`

After completing the steps above, the only rules that eslint will enforce are the ones you define in the `rules` object in `/.eslintrc`.
After completing the steps above, the only rules that eslint will enforce are the ones you define in the `rules` object in `/.eslintrc.js`.


### prettier js formatting

starbase uses [Prettier](https://github.com/prettier/prettier) to enforce and simplify code consistency. If you use VS Code, check out the [Prettier VS Code extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode).

### service worker caching

Expand Down
3 changes: 3 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: ['@babel/preset-env'],
};
Loading

0 comments on commit a6566e7

Please sign in to comment.