Skip to content

Commit

Permalink
Merge pull request #124 from etn-ccis/dev
Browse files Browse the repository at this point in the history
Publish 4.0.0
  • Loading branch information
JeffGreiner-eaton authored Dec 20, 2024
2 parents 8b9210b + 3a8d6e5 commit 7fc7935
Show file tree
Hide file tree
Showing 15 changed files with 1,366 additions and 656 deletions.
Binary file added .DS_Store
Binary file not shown.
43 changes: 0 additions & 43 deletions .circleci/config.yml

This file was deleted.

76 changes: 76 additions & 0 deletions .github/workflows/blui-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Build

on:
push:
branches: ["dev", "master"]
pull_request:
branches: ["dev", "master"]
pull_request_target:
types:
- opened
branches:
- "*/*"

permissions:
pull-requests: write
contents: read

jobs:
verify_artifacts:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

steps:
- name: Checkout
uses: actions/checkout@v4
- run: yarn test
working-directory: eslint-config
- run: yarn test
working-directory: prettier-config

publish_prettier_config:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev') }}
needs: verify_artifacts
strategy:
matrix:
node-version: [20.x]
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
BRANCH: ${{ github.ref == 'refs/heads/master' && 'master' || 'dev' }}
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: "https://registry.npmjs.org"
- run: yarn --immutable
working-directory: prettier-config
- run: npm run publish:package -- -b ${{env.BRANCH}}
working-directory: prettier-config

publish_eslint_config:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev') }}
needs: verify_artifacts
strategy:
matrix:
node-version: [20.x]
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
BRANCH: ${{ github.ref == 'refs/heads/master' && 'master' || 'dev' }}
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: "https://registry.npmjs.org"
- run: yarn --immutable
working-directory: eslint-config
- run: npm run publish:package -- -b ${{env.BRANCH}}
working-directory: eslint-config
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
**/**/node_modules
.idea/
**/**/.DS_Store
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @JeffGreiner-eaton @surajeaton @ektaghag-eaton
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Brightlayer UI Code Standards
[![](https://img.shields.io/npm/v/@brightlayer-ui/eslint-config?label=%40brightlayer-ui%2Feslint-config&style=flat)](https://www.npmjs.com/package/@brightlayer-ui/eslint-config)
[![](https://img.shields.io/npm/v/@brightlayer-ui/prettier-config?label=%40brightlayer-ui%2Fprettier-config&style=flat)](https://www.npmjs.com/package/@brightlayer-ui/prettier-config)
[![](https://img.shields.io/npm/v/@brightlayer-ui/prettier-config?label=%40brightlayer-ui%2Fprettier-config&style=flat)](https://www.npmjs.com/package/@brightlayer-ui/prettier-config)
[![Build](https://github.com/etn-ccis/blui-code-standards/actions/workflows/blui-ci.yml/badge.svg?branch=master)](https://github.com/etn-ccis/blui-code-standards/actions/workflows/blui-ci.yml)

This repository contains resources for ensuring consistency and quality across different Brightlayer UI applications and materials.

Expand Down
12 changes: 12 additions & 0 deletions eslint-config/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## v4.0.0 (December 19, 2024)

### Changed

- Update to support ESlint version 9.
- Removed deprecated no-var-requires rule in favor of no-require-imports rule.
- Removed deprecated no-throw-literal rule.

### Fixed

- Update naming-convention rules ([#96](https://github.com/etn-ccis/blui-code-standards/issues/96)).

## v3.0.1 (June 8, 2022)

### Changed
Expand Down
4 changes: 2 additions & 2 deletions eslint-config/PUBLISHING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Automatic Publishing

This package is published to NPM automatically by CircleCI when code is merged into the `dev` or `master` branches. To publish a new version, simply update the version in `package.json` and merge your code into the appropriate branch.
This package is published to NPM automatically by Github when code is merged into the `dev` or `master` branches. To publish a new version, simply update the version in `package.json` and merge your code into the appropriate branch.

- The `dev` branch will publish versions marked as `alpha` or `beta`.
- The `master` branch will publish any version (`alpha`, `beta`, or `latest`).
Expand All @@ -25,4 +25,4 @@ For this command to work, you must have an NPM token configured in your environm
npm adduser && yarn publish:package
```

> Publishing manually should only be done for `alpha` or `beta` packages. The command will work for `latest` packages, but this should be avoided except in rare situations where the automatic publishing functionality is not working in CircleCI.
> Publishing manually should only be done for `alpha` or `beta` packages. The command will work for `latest` packages, but this should be avoided except in rare situations where the automatic publishing functionality is not working in Github.
17 changes: 8 additions & 9 deletions eslint-config/blui-rules.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const bluiRules = {
module.exports = {
'@typescript-eslint/array-type': ['error', { default: 'array-simple' }],
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'default',
format: ['camelCase'],
format: ['camelCase', 'PascalCase'],
},
{
selector: 'variable',
Expand Down Expand Up @@ -36,18 +36,20 @@ const bluiRules = {
format: ['camelCase'],
leadingUnderscore: 'require',
},

{
selector: 'typeLike',
format: ['PascalCase'],
},
{
selector: 'import',
format: ['camelCase', 'PascalCase'],
},
],
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/explicit-module-boundary-types': ['error', { allowArgumentsExplicitlyTypedAsAny: true }],
'@typescript-eslint/no-array-constructor': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-unnecessary-condition': 'off',
'@typescript-eslint/no-unnecessary-qualifier': 'error',
Expand Down Expand Up @@ -90,7 +92,6 @@ const bluiRules = {
'no-return-assign': 'error',
'no-self-compare': 'error',
'no-sequences': 'error',
'no-throw-literal': 'error',
'no-unused-expressions': 'error',
'no-useless-call': 'error',
'no-undef-init': 'error',
Expand All @@ -110,8 +111,6 @@ const bluiRules = {
'prefer-spread': 'error',
'prefer-template': 'error',
'sort-imports': 'off',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': ['error'],
"no-shadow": "off",
"@typescript-eslint/no-shadow": ["error"]
};

module.exports = bluiRules;
24 changes: 12 additions & 12 deletions eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@brightlayer-ui/eslint-config",
"version": "3.0.1",
"version": "4.0.0",
"description": "ESLint profile for Brightlayer UI",
"author": "Brightlayer UI <[email protected]>",
"main": "index.js",
Expand Down Expand Up @@ -30,16 +30,18 @@
"prettier": "prettier \"**/**.{ts,tsx,js,jsx,json,css,scss,html,md}\" --write"
},
"peerDependencies": {
"@typescript-eslint/eslint-plugin": "^5.9.0",
"eslint": ">= 8.6.0",
"typescript": ">= 4.0.0"
"typescript": "5.7.2"
},
"dependencies": {
"@typescript-eslint/parser": "^5.9.0",
"eslint-config-prettier": ">= 8.0.0"
"@eslint/js": "^9.13.0",
"typescript-eslint": "^8.11.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-config-prettier":"^9.1.0",
"@typescript-eslint/parser": "^8.10.0",
"eslint": ">= 9.12.0"
},
"optionalDependencies": {
"eslint-plugin-react": "^7.28.0"
"eslint-plugin-react": "^7.37.1"
},
"keywords": [
"eslint",
Expand All @@ -51,10 +53,8 @@
"prettier": "@brightlayer-ui/prettier-config",
"devDependencies": {
"@brightlayer-ui/prettier-config": "^1.0.3",
"@typescript-eslint/eslint-plugin": "^5.9.0",
"eslint": ">= 8.6.0",
"eslint-plugin-react": "^7.28.0",
"prettier": "3.0.3",
"typescript": ">= 4.0.0"
"eslint-plugin-react": "^7.37.1",
"prettier": "3.2.5",
"typescript": "5.7.2"
}
}
31 changes: 20 additions & 11 deletions eslint-config/ts.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
const tsProfile = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'eslint-config-prettier',
],
rules: require('./blui-rules'),
};
const js = require('@eslint/js');
const tseslint = require('typescript-eslint');
const prettierRecommended = require('eslint-plugin-prettier/recommended');
const typescriptEslintParser = require('@typescript-eslint/parser');
const bluiRules = require('./blui-rules.js');

module.exports = tsProfile;
module.exports = [
js.configs.recommended,
tseslint.configs.eslintRecommended,
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.stylisticTypeChecked,
prettierRecommended,
{
languageOptions: {
parser: typescriptEslintParser
},
rules: {
...bluiRules
},
}
];
47 changes: 26 additions & 21 deletions eslint-config/tsx.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
const tsxProfile = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'eslint-config-prettier',
],
settings: {
react: {
version: 'detect',
const js = require('@eslint/js');
const reactRecommened = require('eslint-plugin-react/configs/recommended.js');
const tseslint = require('typescript-eslint');
const prettierRecommended = require('eslint-plugin-prettier/recommended');
const typescriptEslintParser = require('@typescript-eslint/parser');
const bluiRules = require('./blui-rules.js');

module.exports = [
js.configs.recommended,
tseslint.configs.eslintRecommended,
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.stylisticTypeChecked,
reactRecommened,
prettierRecommended,
{
languageOptions: {
parser: typescriptEslintParser
},
settings: {
react: {
version: 'detect',
},
},
},
rules: Object.assign(
{
rules: {
'react/prop-types': 'off',
'react/display-name': 'off',
...bluiRules
},
require('./blui-rules')
),
};

module.exports = tsxProfile;
}
];
Loading

0 comments on commit 7fc7935

Please sign in to comment.