Skip to content

Commit

Permalink
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 79 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ jobs:
executor: frontend/node
steps:
- checkout-and-restore-cache
- frontend/lint:
step-name: Prettier
script: prettier
- frontend/lint:
step-name: ESLint
script: eslint
- frontend/lint:
step-name: Prettier JSON
script: prettier-json

# -------------------------------------------------------------------------------------------------
# WORKFLOWS
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CHANGELOG.md
6 changes: 2 additions & 4 deletions @ornikar/browserslist-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ in `package.json`:

```json
{
"browserslist": [
"extends @ornikar/browserlist-config"
]
"browserslist": ["extends @ornikar/browserlist-config"]
}
```

## Supported browsers

- Degraded support: https://browserl.ist/?q=last+4+versions%2C+%3E+.2%25+in+FR%2C+Firefox+ESR%2C+not+ie+%3C+10%2C+not+ios+%3C+10%2C+not+op_mini+all
- Full support: https://browserl.ist/?q=last+4+versions%2C+%3E+1%25+in+FR%2C+Firefox+ESR%2C+not+ie+%3C+12%2C+not+op_mini+all
- Full support: https://browserl.ist/?q=last+4+versions%2C+%3E+1%25+in+FR%2C+Firefox+ESR%2C+not+ie+%3C+12%2C+not+op_mini+all

Degraded support: the website must be usable but don't have to be pixel perfect or pretty.
1 change: 0 additions & 1 deletion @ornikar/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"eslint-plugin-filenames": "^1.3.2",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-unicorn": "^14.0.1"
},
"peerDependencies": {
Expand Down
3 changes: 0 additions & 3 deletions @ornikar/eslint-config/plugins/prettier.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
'use strict';

module.exports = {
plugins: ['prettier'],
extends: ['eslint-config-prettier'].map(require.resolve),

rules: {
'prettier/prettier': 'error',

// https://github.com/prettier/eslint-config-prettier#curly
// prettier doesn't enforce {} with multiline
curly: ['error', 'multi-line'],
Expand Down
12 changes: 5 additions & 7 deletions @ornikar/postcss-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ Configure browserslist with `@ornikar/browserslist-config`.

Create `postcss.config.js`:

```js
```js
const plugins = require('@ornikar/postcss-config');

module.exports = ({ options }) => ({
plugins: [
...plugins.syntaxPlugins(),

plugins.themePlugin({
importFrom: 'path/to/theme.css',
preserve: process.env.NODE_ENV !== 'production',
Expand All @@ -26,13 +26,11 @@ module.exports = ({ options }) => ({
}),

plugins.autoprefixerPlugin(),

// add other plugins if you need to :)

// production
...(process.env.NODE_ENV === 'production'
? plugins.productionPlugins()
: []),
...(process.env.NODE_ENV === 'production' ? plugins.productionPlugins() : []),
],
});
```
2 changes: 1 addition & 1 deletion @ornikar/repo-config-react/createLintStagedConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const createBaseLintStagedConfig = require('@ornikar/repo-config/createLintStage
const pkg = JSON.parse(fs.readFileSync(path.resolve('package.json'), 'utf-8'));

module.exports = function createLintStagedConfig(options = {}) {
const config = createBaseLintStagedConfig({ srcExtensions: ['js', 'ts', 'tsx'] });
const config = createBaseLintStagedConfig({ srcExtensions: ['js', 'mjs', 'ts', 'tsx'] });

// eslint-disable-next-line prefer-destructuring
const srcDirectories = createBaseLintStagedConfig.getSrcDirectories();
Expand Down
15 changes: 4 additions & 11 deletions @ornikar/repo-config/createLintStagedConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const getSrcDirectories = (srcDirectoryName = 'src') =>
workspaces ? `{${workspaces.join(',')}}${srcDirectoryName && `/${srcDirectoryName}`}` : srcDirectoryName;

module.exports = function createLintStagedConfig(options = {}) {
const srcExtensions = options.srcExtensions || ['js'];
const srcExtensions = options.srcExtensions || ['js', 'mjs', 'ts'];
const srcDirectories = getSrcDirectories(options.srcDirectoryName);

return {
Expand All @@ -33,17 +33,10 @@ module.exports = function createLintStagedConfig(options = {}) {
shouldGenerateTsconfigInLernaRepo && 'git add **/tsconfig.json **/tsconfig.build.json',
].filter(Boolean);
},
[`{*.json${workspaces ? `,${workspaces.map((workspacePath) => `${workspacePath}/*.json`).join(',')}` : ''}}`]: (
filenames,
) => {
const filteredFilenames = filenames.filter((name) => !name.endsWith('/package.json'));
if (filteredFilenames.length === 0) return [];
return [`prettier --write ${filteredFilenames.join(' ')}`];
},
'!(package).json': ['prettier --write'],
'*.{yml,yaml,md,html}': ['prettier --write'],
[`*.{${srcExtensions.join(',')}}`]: ['prettier --write', 'eslint --fix --quiet'],
[`{.storybook,${srcDirectories}}/**/*.css`]: ['prettier --parser css --write', 'stylelint --quiet --fix'],

[`${srcDirectories}/**/*.{${srcExtensions.join(',')}}`]: ['eslint --fix --quiet'],
'{scripts,config,.storyboook}/*.js': ['eslint --fix --quiet'],
};
};

Expand Down
4 changes: 1 addition & 3 deletions @ornikar/rollup-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

Ornikar rollup config


create a file `rollup.config.js`:

```js
```js
'use strict';

const createConfig = require('@ornikar/rollup-config');

module.exports = createConfig();

```
1 change: 1 addition & 0 deletions @ornikar/test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,28 @@

This repository is a monorepo that we manage using [Lerna](https://github.com/lerna/lerna).

| Package | Version | Description |
|---------|---------|-------------|
| [@ornikar/browserslist-config](/@ornikar/browserslist-config) | <a href="https://npmjs.org/package/@ornikar/browserslist-config"><img src="https://img.shields.io/npm/v/@ornikar/browserslist-config.svg?style=flat-square"></a> | browserslist config
| [@ornikar/commitlint-config](/@ornikar/commitlint-config) | <a href="https://npmjs.org/package/@ornikar/commitlint-config"><img src="https://img.shields.io/npm/v/@ornikar/commitlint-config.svg?style=flat-square"></a> | commitlint config
| [@ornikar/eslint-config](/@ornikar/eslint-config) | <a href="https://npmjs.org/package/@ornikar/eslint-config"><img src="https://img.shields.io/npm/v/@ornikar/eslint-config.svg?style=flat-square"></a> | eslint config files
| [@ornikar/eslint-config-babel](/@ornikar/eslint-config-babel) | <a href="https://npmjs.org/package/@ornikar/eslint-config-babel"><img src="https://img.shields.io/npm/v/@ornikar/eslint-config-babel.svg?style=flat-square"></a> | eslint babel config files
| [@ornikar/eslint-config-babel-use](/@ornikar/eslint-config-babel-use) | <a href="https://npmjs.org/package/@ornikar/eslint-config-babel-use"><img src="https://img.shields.io/npm/v/@ornikar/eslint-config-babel-use.svg?style=flat-square"></a> | eslint babel use config files
| [@ornikar/eslint-config-formatjs](/@ornikar/eslint-config-formatjs) | <a href="https://npmjs.org/package/@ornikar/eslint-config-formatjs"><img src="https://img.shields.io/npm/v/@ornikar/eslint-config-formatjs.svg?style=flat-square"></a> | eslint formatjs config files
| [@ornikar/eslint-config-node](/@ornikar/eslint-config-node) | <a href="https://npmjs.org/package/@ornikar/eslint-config-node"><img src="https://img.shields.io/npm/v/@ornikar/eslint-config-node.svg?style=flat-square"></a> | eslint node config files
| [@ornikar/eslint-config-react](/@ornikar/eslint-config-react) | <a href="https://npmjs.org/package/@ornikar/eslint-config-react"><img src="https://img.shields.io/npm/v/@ornikar/eslint-config-react.svg?style=flat-square"></a> | eslint react config files
| [@ornikar/eslint-config-typescript](/@ornikar/eslint-config-typescript) | <a href="https://npmjs.org/package/@ornikar/eslint-config-typescript"><img src="https://img.shields.io/npm/v/@ornikar/eslint-config-typescript.svg?style=flat-square"></a> | eslint typescript config files
| [@ornikar/eslint-config-typescript-react](/@ornikar/eslint-config-typescript-react) | <a href="https://npmjs.org/package/@ornikar/eslint-config-typescript-react"><img src="https://img.shields.io/npm/v/@ornikar/eslint-config-typescript-react.svg?style=flat-square"></a> | eslint typescript-react config files
| [@ornikar/intl-config](/@ornikar/intl-config) | <a href="https://npmjs.org/package/@ornikar/intl-config"><img src="https://img.shields.io/npm/v/@ornikar/intl-config.svg?style=flat-square"></a> | intl config
| [@ornikar/jest-config](/@ornikar/jest-config) | <a href="https://npmjs.org/package/@ornikar/jest-config"><img src="https://img.shields.io/npm/v/@ornikar/jest-config.svg?style=flat-square"></a> | jest config
| [@ornikar/jest-config-react](/@ornikar/jest-config-react) | <a href="https://npmjs.org/package/@ornikar/jest-config-react"><img src="https://img.shields.io/npm/v/@ornikar/jest-config-react.svg?style=flat-square"></a> | jest react config
| [@ornikar/lerna-config](/@ornikar/lerna-config) | <a href="https://npmjs.org/package/@ornikar/lerna-config"><img src="https://img.shields.io/npm/v/@ornikar/lerna-config.svg?style=flat-square"></a> | lerna config
| [@ornikar/postcss-config](/@ornikar/postcss-config) | <a href="https://npmjs.org/package/@ornikar/postcss-config"><img src="https://img.shields.io/npm/v/@ornikar/postcss-config.svg?style=flat-square"></a> | postcss config
| [@ornikar/prettier-config](/@ornikar/prettier-config) | <a href="https://npmjs.org/package/@ornikar/prettier-config"><img src="https://img.shields.io/npm/v/@ornikar/prettier-config.svg?style=flat-square"></a> | prettier config
| [@ornikar/renovate-config](/@ornikar/renovate-config) | <a href="https://npmjs.org/package/@ornikar/renovate-config"><img src="https://img.shields.io/npm/v/@ornikar/renovate-config.svg?style=flat-square"></a> | renovate config
| [@ornikar/repo-config](/@ornikar/repo-config) | <a href="https://npmjs.org/package/@ornikar/repo-config"><img src="https://img.shields.io/npm/v/@ornikar/repo-config.svg?style=flat-square"></a> | repo config
| [@ornikar/repo-config-react](/@ornikar/repo-config-react) | <a href="https://npmjs.org/package/@ornikar/repo-config-react"><img src="https://img.shields.io/npm/v/@ornikar/repo-config-react.svg?style=flat-square"></a> | react repo config
| [@ornikar/rollup-config](/@ornikar/rollup-config) | <a href="https://npmjs.org/package/@ornikar/rollup-config"><img src="https://img.shields.io/npm/v/@ornikar/rollup-config.svg?style=flat-square"></a> | rollup config
| [@ornikar/storybook-config](/@ornikar/storybook-config) | <a href="https://npmjs.org/package/@ornikar/storybook-config"><img src="https://img.shields.io/npm/v/@ornikar/storybook-config.svg?style=flat-square"></a> | storybook config
| [@ornikar/stylelint-config](/@ornikar/stylelint-config) | <a href="https://npmjs.org/package/@ornikar/stylelint-config"><img src="https://img.shields.io/npm/v/@ornikar/stylelint-config.svg?style=flat-square"></a> | stylelint config
| [@ornikar/webpack-config](/@ornikar/webpack-config) | <a href="https://npmjs.org/package/@ornikar/webpack-config"><img src="https://img.shields.io/npm/v/@ornikar/webpack-config.svg?style=flat-square"></a> | webpack config
| Package | Version | Description |
| ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
| [@ornikar/browserslist-config](/@ornikar/browserslist-config) | <a href="https://npmjs.org/package/@ornikar/browserslist-config"><img src="https://img.shields.io/npm/v/@ornikar/browserslist-config.svg?style=flat-square"></a> | browserslist config |
| [@ornikar/commitlint-config](/@ornikar/commitlint-config) | <a href="https://npmjs.org/package/@ornikar/commitlint-config"><img src="https://img.shields.io/npm/v/@ornikar/commitlint-config.svg?style=flat-square"></a> | commitlint config |
| [@ornikar/eslint-config](/@ornikar/eslint-config) | <a href="https://npmjs.org/package/@ornikar/eslint-config"><img src="https://img.shields.io/npm/v/@ornikar/eslint-config.svg?style=flat-square"></a> | eslint config files |
| [@ornikar/eslint-config-babel](/@ornikar/eslint-config-babel) | <a href="https://npmjs.org/package/@ornikar/eslint-config-babel"><img src="https://img.shields.io/npm/v/@ornikar/eslint-config-babel.svg?style=flat-square"></a> | eslint babel config files |
| [@ornikar/eslint-config-babel-use](/@ornikar/eslint-config-babel-use) | <a href="https://npmjs.org/package/@ornikar/eslint-config-babel-use"><img src="https://img.shields.io/npm/v/@ornikar/eslint-config-babel-use.svg?style=flat-square"></a> | eslint babel use config files |
| [@ornikar/eslint-config-formatjs](/@ornikar/eslint-config-formatjs) | <a href="https://npmjs.org/package/@ornikar/eslint-config-formatjs"><img src="https://img.shields.io/npm/v/@ornikar/eslint-config-formatjs.svg?style=flat-square"></a> | eslint formatjs config files |
| [@ornikar/eslint-config-node](/@ornikar/eslint-config-node) | <a href="https://npmjs.org/package/@ornikar/eslint-config-node"><img src="https://img.shields.io/npm/v/@ornikar/eslint-config-node.svg?style=flat-square"></a> | eslint node config files |
| [@ornikar/eslint-config-react](/@ornikar/eslint-config-react) | <a href="https://npmjs.org/package/@ornikar/eslint-config-react"><img src="https://img.shields.io/npm/v/@ornikar/eslint-config-react.svg?style=flat-square"></a> | eslint react config files |
| [@ornikar/eslint-config-typescript](/@ornikar/eslint-config-typescript) | <a href="https://npmjs.org/package/@ornikar/eslint-config-typescript"><img src="https://img.shields.io/npm/v/@ornikar/eslint-config-typescript.svg?style=flat-square"></a> | eslint typescript config files |
| [@ornikar/eslint-config-typescript-react](/@ornikar/eslint-config-typescript-react) | <a href="https://npmjs.org/package/@ornikar/eslint-config-typescript-react"><img src="https://img.shields.io/npm/v/@ornikar/eslint-config-typescript-react.svg?style=flat-square"></a> | eslint typescript-react config files |
| [@ornikar/intl-config](/@ornikar/intl-config) | <a href="https://npmjs.org/package/@ornikar/intl-config"><img src="https://img.shields.io/npm/v/@ornikar/intl-config.svg?style=flat-square"></a> | intl config |
| [@ornikar/jest-config](/@ornikar/jest-config) | <a href="https://npmjs.org/package/@ornikar/jest-config"><img src="https://img.shields.io/npm/v/@ornikar/jest-config.svg?style=flat-square"></a> | jest config |
| [@ornikar/jest-config-react](/@ornikar/jest-config-react) | <a href="https://npmjs.org/package/@ornikar/jest-config-react"><img src="https://img.shields.io/npm/v/@ornikar/jest-config-react.svg?style=flat-square"></a> | jest react config |
| [@ornikar/lerna-config](/@ornikar/lerna-config) | <a href="https://npmjs.org/package/@ornikar/lerna-config"><img src="https://img.shields.io/npm/v/@ornikar/lerna-config.svg?style=flat-square"></a> | lerna config |
| [@ornikar/postcss-config](/@ornikar/postcss-config) | <a href="https://npmjs.org/package/@ornikar/postcss-config"><img src="https://img.shields.io/npm/v/@ornikar/postcss-config.svg?style=flat-square"></a> | postcss config |
| [@ornikar/prettier-config](/@ornikar/prettier-config) | <a href="https://npmjs.org/package/@ornikar/prettier-config"><img src="https://img.shields.io/npm/v/@ornikar/prettier-config.svg?style=flat-square"></a> | prettier config |
| [@ornikar/renovate-config](/@ornikar/renovate-config) | <a href="https://npmjs.org/package/@ornikar/renovate-config"><img src="https://img.shields.io/npm/v/@ornikar/renovate-config.svg?style=flat-square"></a> | renovate config |
| [@ornikar/repo-config](/@ornikar/repo-config) | <a href="https://npmjs.org/package/@ornikar/repo-config"><img src="https://img.shields.io/npm/v/@ornikar/repo-config.svg?style=flat-square"></a> | repo config |
| [@ornikar/repo-config-react](/@ornikar/repo-config-react) | <a href="https://npmjs.org/package/@ornikar/repo-config-react"><img src="https://img.shields.io/npm/v/@ornikar/repo-config-react.svg?style=flat-square"></a> | react repo config |
| [@ornikar/rollup-config](/@ornikar/rollup-config) | <a href="https://npmjs.org/package/@ornikar/rollup-config"><img src="https://img.shields.io/npm/v/@ornikar/rollup-config.svg?style=flat-square"></a> | rollup config |
| [@ornikar/storybook-config](/@ornikar/storybook-config) | <a href="https://npmjs.org/package/@ornikar/storybook-config"><img src="https://img.shields.io/npm/v/@ornikar/storybook-config.svg?style=flat-square"></a> | storybook config |
| [@ornikar/stylelint-config](/@ornikar/stylelint-config) | <a href="https://npmjs.org/package/@ornikar/stylelint-config"><img src="https://img.shields.io/npm/v/@ornikar/stylelint-config.svg?style=flat-square"></a> | stylelint config |
| [@ornikar/webpack-config](/@ornikar/webpack-config) | <a href="https://npmjs.org/package/@ornikar/webpack-config"><img src="https://img.shields.io/npm/v/@ornikar/webpack-config.svg?style=flat-square"></a> | webpack config |
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"private": true,
"repository": "ornikar/shared-configs",
"scripts": {
"lint:prettier": "prettier --check .",
"lint:eslint": "eslint --ext .js --fix .",
"lint:prettier-json": "prettier --check {*.json,@ornikar/*/*.json}",
"release": "lerna publish --conventional-commits -m 'chore: release'"
},
"prettier": "./@ornikar/prettier-config",
Expand Down Expand Up @@ -32,7 +32,6 @@
"eslint-plugin-filenames": "1.3.2",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-node": "10.0.0",
"eslint-plugin-prettier": "3.3.1",
"eslint-plugin-unicorn": "14.0.1",
"husky": "4.3.8",
"lerna": "3.22.1",
Expand Down
Loading

0 comments on commit b7fbf89

Please sign in to comment.