Skip to content

Commit

Permalink
Merge pull request #30 from Adyen/develop
Browse files Browse the repository at this point in the history
Release 1.0.1
  • Loading branch information
georgefromadyen authored Mar 8, 2024
2 parents 8b7f311 + 5afdf21 commit e941052
Show file tree
Hide file tree
Showing 76 changed files with 1,375 additions and 1,160 deletions.
2 changes: 0 additions & 2 deletions .browserslistrc

This file was deleted.

138 changes: 138 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['react', '@typescript-eslint', 'import', 'jsx-a11y'],
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended' /*'prettier/@typescript-eslint'*/,
],
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
modules: true,
jsx: true,
},
},
env: {
browser: true,
node: true,
es2020: true,
},
settings: {
react: {
pragma: 'h',
version: '16.0',
},
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
typescript: {
project: './tsconfig.json',
},
},
},
rules: {
'no-console': 0,
'class-methods-use-this': 'off',
'no-underscore-dangle': 'off',
'import/prefer-default-export': 'off',
'no-debugger': 'warn',
indent: 'off',
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
// Disabled: doesn't play well with workspaces, more investigation needed
// 'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
'max-len': [
'error',
{
code: 150,
tabWidth: 2,
ignoreComments: true, // Allow long comments in the code
ignoreUrls: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
},
],
'prefer-destructuring': 'off',
'arrow-parens': [0, 'as-needed'],
// Do not care about dangling comma presence
'comma-dangle': 'off',
// // Do not care about operators linebreak
'operator-linebreak': 'off',
// // Do not care about arrow function linebreak
'implicit-arrow-linebreak': 'off',
// // Do not care about empty lines about props
'lines-between-class-members': 'off',
// This is not important rule
'object-curly-newline': 'off',
// // Styling rule which doesn't add anything
'no-multiple-empty-lines': 'off',
// This rule doesn't make sense in the latest browsers
radix: 'off',
// This serves no practical purpose
'eol-last': 'off',

// the base rule can report incorrect errors
'no-useless-constructor': 'off',

// Typescript Rules
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true, vars: 'local' }],
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/indent': 'off',
'@typescript-eslint/no-empty-function': ['error', { allow: ['arrowFunctions'] }],
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',

// React Rules
'react/prop-types': 'off',
'react/display-name': 'off',

// a11y
'jsx-a11y/alt-text': 'error',
'jsx-a11y/aria-role': 'error',
'jsx-a11y/aria-props': 'error',
'jsx-a11y/aria-unsupported-elements': 'error',
'jsx-a11y/role-has-required-aria-props': 'error',
'jsx-a11y/role-supports-aria-props': 'error',
'jsx-a11y/tabindex-no-positive': 'error',
'jsx-a11y/no-redundant-roles': 'error',
'jsx-a11y/anchor-has-content': 'error',
'jsx-a11y/anchor-is-valid': 'error',
'jsx-a11y/img-redundant-alt': 'error',
'jsx-a11y/interactive-supports-focus': 'error',
'jsx-a11y/autocomplete-valid': 'error',
'jsx-a11y/no-static-element-interactions': 'error',
'jsx-a11y/no-noninteractive-tabindex': 'error',
'jsx-a11y/mouse-events-have-key-events': 'error',

// Debugging import rules.
// These can be computationally expensive, enable them sparingly.
'import/no-cycle': 'error',
},
overrides: [
{
// enable the rule specifically for TypeScript files
files: ['*.ts', '*.tsx'],
rules: {
'@typescript-eslint/explicit-member-accessibility': [
'error',
{ accessibility: 'off', overrides: { properties: 'explicit' } },
],
},
},
],
};
138 changes: 0 additions & 138 deletions .eslintrc.js

This file was deleted.

2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Change tab width to 2
65c4ba06306fe0b1dedab4a8ae11e769305727c9
12 changes: 6 additions & 6 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18
- run: npm i

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18
registry-url: https://registry.npmjs.org/
- run: npm i
- run: npm run build
Expand Down
43 changes: 22 additions & 21 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
const bemPattern = '^.[adv|adyen]*(?:-[a-zA-Z0-9]+)*(?:__[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*)?(?:--[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*)?(?:\\[.+\\])?$';
const bemPattern =
'^.[adv|adyen]*(?:-[a-zA-Z0-9]+)*(?:__[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*)?(?:--[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*)?(?:\\[.+\\])?$';

module.exports = {
syntax: 'scss',
extends: ['stylelint-config-recommended', 'stylelint-config-sass-guidelines'],
plugins: ['stylelint-scss'],
rules: {
indentation: [4, { indentClosingBrace: false }],
'max-empty-lines': 3,
'max-nesting-depth': 3,
'no-descending-specificity': null,
'property-no-vendor-prefix': null,
'selector-no-vendor-prefix': null,
syntax: 'scss',
extends: ['stylelint-config-recommended', 'stylelint-config-sass-guidelines'],
plugins: ['stylelint-scss'],
rules: {
indentation: [2, { indentClosingBrace: false }],
'max-empty-lines': 3,
'max-nesting-depth': 3,
'no-descending-specificity': null,
'property-no-vendor-prefix': null,
'selector-no-vendor-prefix': null,

// Replaced CSS with SCSS rules
'at-rule-no-unknown': null,
// Replaced CSS with SCSS rules
'at-rule-no-unknown': null,

// stylelint-scss plugin
'scss/at-rule-no-unknown': true,
// stylelint-scss plugin
'scss/at-rule-no-unknown': true,

// BEM naming
'selector-class-pattern': [bemPattern, { resolveNestedSelectors: true }],
'scss/at-mixin-pattern': bemPattern,
'scss/dollar-variable-pattern': bemPattern,
// BEM naming
'selector-class-pattern': [bemPattern, { resolveNestedSelectors: true }],
'scss/at-mixin-pattern': bemPattern,
'scss/dollar-variable-pattern': bemPattern,

'scss/at-import-partial-extension-blacklist': null
}
'scss/at-import-partial-extension-blacklist': null,
},
};
Loading

0 comments on commit e941052

Please sign in to comment.