Skip to content

Commit

Permalink
feat: initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
wkillerud committed Jul 30, 2024
0 parents commit cb1bb56
Show file tree
Hide file tree
Showing 12 changed files with 181 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
29 changes: 29 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Publish

on:
push:
branches:
- main
- alpha
- beta
- next

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20

- run: npm install

- run: npm run lint

- run: npx semantic-release
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Test

on:
push:
branches-ignore:
- main
- alpha
- beta
- next

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20

- run: npm install

- run: npm run lint
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package-lock=false
save-exact=true
12 changes: 12 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"useTabs": true,
"overrides": [
{
"files": ["*.yml", "*.json"],
"options": {
"tabWidth": 2,
"useTabs": false
}
}
]
}
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Contributing

Thank you for showing an interest in contributing to Eik 🧡

This module is a [shared config for ESLint](https://eslint.org/docs/latest/extend/shareable-configs). We accept changes that should apply to all repositories in the [eik-lib origanisation](https://github.com/eik-lib).

Commits should follow the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) format.

A change in configuration is considered a `patch` in [semantic versioning](https://semver.org/). A new export would be a `minor`. Updating the `peerDependency` to a higher version would be a `major`.

This repo uses [semantic release](https://github.com/semantic-release/semantic-release) to automate releases whenever changes are merged to the default branch.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# @eik/eslint-config

Shared config for ESLint used in Eik projects.

## Install

```
npm install --save-dev eslint @eik/eslint-config
```

## Usage

The default config should cover most needs, but you can extend or override if you need to.

```js
// eslint.config.js

import config from "@eik/eslint-config";

export default [
...config,
/* Your customisations */
];
```

If you do need to change the config, consider whether that change should happen here in the shared config so it applies to all repos.
3 changes: 3 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import eikEslintConfig from "./lib/default.js";

export default [...eikEslintConfig];
12 changes: 12 additions & 0 deletions lib/base.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import prettierConfig from "eslint-config-prettier";
import prettierPlugin from "eslint-plugin-prettier/recommended";
import js from "@eslint/js";

export default [
js.configs.recommended,
prettierConfig,
prettierPlugin,
{
ignores: ["coverage/*", "node_modules/*", "tap-snapshots/*"],
},
];
14 changes: 14 additions & 0 deletions lib/default.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import globals from "globals";
import base from "./base.js";

export default [
...base,
{
languageOptions: {
globals: {
...globals.node,
...globals.browser,
},
},
},
];
47 changes: 47 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "@eik/eslint-config",
"version": "1.0.0",
"description": "Shared ESLint config for Eik modules",
"type": "module",
"exports": {
".": {
"default": "./lib/default.js"
}
},
"files": [
"lib"
],
"repository": {
"type": "git",
"url": "git+ssh://[email protected]/eik-lib/eslint-config.git"
},
"publishConfig": {
"access": "public"
},
"bugs": {
"url": "https://github.com/eik-lib/eslint-config/issues"
},
"homepage": "https://github.com/eik-lib/eslint-config#readme",
"scripts": {
"lint": "eslint .",
"lint:fix": "npm run lint -- --fix",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"eslint",
"eslintconfig"
],
"author": "",
"license": "ISC",
"peerDependencies": {
"eslint": ">= 9"
},
"dependencies": {
"eslint-config-prettier": "9.1.0",
"eslint-plugin-prettier": "5.2.1",
"globals": "15.8.0"
},
"devDependencies": {
"eslint": "9.8.0"
}
}

0 comments on commit cb1bb56

Please sign in to comment.