Skip to content

Commit

Permalink
DEAD-13: add bundler + ts support (#6)
Browse files Browse the repository at this point in the history
* app build: add webpack dep

* app build: make module private

* app build: change project structure

* app build: add webpack config

* app build: add build script

* dist feat: run build

* app build: add ts support

* app build: add css loader

* app build: add post-css loader

* app build: change style regexp

* app build: add babel

* app build: webpack ref

* app build: add eslint ignore

* app build: add prettier ignore

* app build: update .gitignore

* app ref: rm ignored files

* app build: fix webpack config

* app build: add babel plugin for ts

* app build: add title for webpack plugin

* app build: add source map

* app build: add style loader

* app build: add sass loader

* app build: remove src contents

* app build: fix eslint ignore

* app ci: disable legacy linter for ts

* app build: update webpack options

* app build: setup dev server

* app build: ref entry path

* app build: change npm start

* app build: fix configs

* app ci: remove super linter

* app ci: add npm install

* app ci: add node setup action

* app ci: add npx to eslint call

* app ci: add npm ci

* app ci: update setup-node

* app build: add hbs loader

* app ref: delete example index.ts
  • Loading branch information
darleet authored Oct 17, 2024
1 parent 4584665 commit dec4a26
Show file tree
Hide file tree
Showing 13 changed files with 10,084 additions and 1,727 deletions.
14 changes: 14 additions & 0 deletions .babelrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
presets: [
[
'@babel/preset-env',
{
targets: {
esmodules: true,
},
bugfixes: true,
},
],
'@babel/preset-typescript',
],
};
3 changes: 3 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Browsers that we support

defaults
19 changes: 10 additions & 9 deletions .github/workflows/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ jobs:
with:
fetch-depth: 0

- name: Super-linter
uses: super-linter/super-linter/[email protected]
env:
VALIDATE_JAVASCRIPT_STANDARD: false
VALIDATE_JSON: false
VALIDATE_CHECKOV: false
LINTER_RULES_PATH: /
JAVASCRIPT_ES_CONFIG_FILE: eslint.config.js
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install modules
run: npm ci

- name: Lint code
run: npx eslint .
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@

# Node JS
node_modules/

# Build
dist/
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
dist/
21 changes: 12 additions & 9 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
const prettier = require('eslint-plugin-prettier');
import prettier from 'eslint-plugin-prettier';
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

module.exports = [
export default tseslint.config(
{
files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'],
languageOptions: {
ecmaVersion: 2021,
sourceType: 'module',
},
ignores: ['node_modules/*', 'dist/*', '.babelrc.cjs', 'webpack.config.cjs'],
},
{
files: ['**/*.{ts,js}'],
plugins: {
prettier,
},
rules: {
'prettier/prettier': 'error',
semi: ['warn', 'always'],
},
},
];
eslint.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.stylistic,
);
Loading

0 comments on commit dec4a26

Please sign in to comment.